Skip to content

Commit a10dd6a

Browse files
DOC: clean-up of docstrings (part 1)
1 parent bd540a4 commit a10dd6a

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

pandas/core/frame.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,11 @@ class DataFrame(NDFrame):
363363
364364
See also
365365
--------
366-
DataFrame.from_records: constructor from tuples, also record arrays
367-
DataFrame.from_dict: from dicts of Series, arrays, or dicts
368-
DataFrame.from_csv: from CSV files
369-
DataFrame.from_items: from sequence of (key, value) pairs
370-
read_csv / read_table / read_clipboard
366+
DataFrame.from_records : constructor from tuples, also record arrays
367+
DataFrame.from_dict : from dicts of Series, arrays, or dicts
368+
DataFrame.from_csv : from CSV files
369+
DataFrame.from_items : from sequence of (key, value) pairs
370+
pandas.read_csv, pandas.read_table, pandas.read_clipboard
371371
"""
372372
_auto_consolidate = True
373373
_verbose_info = True
@@ -943,7 +943,7 @@ def from_records(cls, data, index=None, exclude=None, columns=None,
943943
index : string, list of fields, array-like
944944
Field of array to use as the index, alternately a specific set of
945945
input labels to use
946-
exclude: sequence, default None
946+
exclude : sequence, default None
947947
Columns or fields to exclude
948948
columns : sequence, default None
949949
Column names to use. If the passed data do not have named
@@ -1378,15 +1378,17 @@ def to_excel(self, excel_writer, sheet_name='sheet1', na_rep='',
13781378
Column label for index column(s) if desired. If None is given, and
13791379
`header` and `index` are True, then the index names are used. A
13801380
sequence should be given if the DataFrame uses MultiIndex.
1381-
startow : upper left cell row to dump data frame
1382-
startcol : upper left cell column to dump data frame
1383-
1381+
startow :
1382+
upper left cell row to dump data frame
1383+
startcol :
1384+
upper left cell column to dump data frame
13841385
13851386
Notes
13861387
-----
13871388
If passing an existing ExcelWriter object, then the sheet will be added
13881389
to the existing workbook. This can be used to save different
1389-
DataFrames to one workbook
1390+
DataFrames to one workbook::
1391+
13901392
>>> writer = ExcelWriter('output.xlsx')
13911393
>>> df1.to_excel(writer,'sheet1')
13921394
>>> df2.to_excel(writer,'sheet2')
@@ -2070,7 +2072,7 @@ def xs(self, key, axis=0, level=None, copy=True, drop_level=True):
20702072
which levels are used. Levels can be referred by label or position.
20712073
copy : boolean, default True
20722074
Whether to make a copy of the data
2073-
drop_level, default True
2075+
drop_level : boolean, default True
20742076
If False, returns object with same levels as self.
20752077
20762078
Examples
@@ -3775,9 +3777,9 @@ def corr(self, method='pearson', min_periods=1):
37753777
Parameters
37763778
----------
37773779
method : {'pearson', 'kendall', 'spearman'}
3778-
pearson : standard correlation coefficient
3779-
kendall : Kendall Tau correlation coefficient
3780-
spearman : Spearman rank correlation
3780+
* pearson : standard correlation coefficient
3781+
* kendall : Kendall Tau correlation coefficient
3782+
* spearman : Spearman rank correlation
37813783
min_periods : int, optional
37823784
Minimum number of observations required per pair of columns
37833785
to have a valid result. Currently only available for pearson

pandas/core/series.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ def value_counts(self, normalize=False, sort=True, ascending=False, bins=None):
15711571
15721572
Parameters
15731573
----------
1574-
normalize: boolean, default False
1574+
normalize : boolean, default False
15751575
If True then the Series returned will contain the relative
15761576
frequencies of the unique values.
15771577
sort : boolean, default True
@@ -2033,9 +2033,9 @@ def corr(self, other, method='pearson',
20332033
----------
20342034
other : Series
20352035
method : {'pearson', 'kendall', 'spearman'}
2036-
pearson : standard correlation coefficient
2037-
kendall : Kendall Tau correlation coefficient
2038-
spearman : Spearman rank correlation
2036+
* pearson : standard correlation coefficient
2037+
* kendall : Kendall Tau correlation coefficient
2038+
* spearman : Spearman rank correlation
20392039
min_periods : int, optional
20402040
Minimum number of observations needed to have a valid result
20412041
@@ -2454,10 +2454,10 @@ def rank(self, method='average', na_option='keep', ascending=True):
24542454
Parameters
24552455
----------
24562456
method : {'average', 'min', 'max', 'first'}
2457-
average: average rank of group
2458-
min: lowest rank in group
2459-
max: highest rank in group
2460-
first: ranks assigned in order they appear in the array
2457+
* average: average rank of group
2458+
* min: lowest rank in group
2459+
* max: highest rank in group
2460+
* first: ranks assigned in order they appear in the array
24612461
na_option : {'keep'}
24622462
keep: leave NA values where they are
24632463
ascending : boolean, default True

0 commit comments

Comments
 (0)