Skip to content

Commit 485e7cd

Browse files
avolkovjreback
authored andcommitted
DOC: Capitalize docstring summaries of Series (pandas-dev#23647)
1 parent f2ff633 commit 485e7cd

File tree

6 files changed

+69
-33
lines changed

6 files changed

+69
-33
lines changed

pandas/core/arrays/sparse.py

+4
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,10 @@ def _make_index(length, indices, kind):
18611861
'sp_values'],
18621862
typ='property')
18631863
class SparseAccessor(PandasDelegate):
1864+
"""
1865+
Accessor for SparseSparse from other sparse matrix data types.
1866+
"""
1867+
18641868
def __init__(self, data=None):
18651869
self._validate(data)
18661870
# Store the Series since we need that for to_coo

pandas/core/base.py

+37-19
Original file line numberDiff line numberDiff line change
@@ -668,12 +668,14 @@ class IndexOpsMixin(object):
668668
__array_priority__ = 1000
669669

670670
def transpose(self, *args, **kwargs):
671-
""" return the transpose, which is by definition self """
671+
"""
672+
Return the transpose, which is by definition self.
673+
"""
672674
nv.validate_transpose(args, kwargs)
673675
return self
674676

675-
T = property(transpose, doc="return the transpose, which is by "
676-
"definition self")
677+
T = property(transpose, doc="Return the transpose, which is by "
678+
"definition self.")
677679

678680
@property
679681
def _is_homogeneous_type(self):
@@ -692,19 +694,21 @@ def _is_homogeneous_type(self):
692694

693695
@property
694696
def shape(self):
695-
""" return a tuple of the shape of the underlying data """
697+
"""
698+
Return a tuple of the shape of the underlying data.
699+
"""
696700
return self._values.shape
697701

698702
@property
699703
def ndim(self):
700-
""" return the number of dimensions of the underlying data,
701-
by definition 1
704+
"""
705+
Number of dimensions of the underlying data, by definition 1.
702706
"""
703707
return 1
704708

705709
def item(self):
706-
""" return the first element of the underlying data as a python
707-
scalar
710+
"""
711+
Return the first element of the underlying data as a python scalar.
708712
"""
709713
try:
710714
return self.values.item()
@@ -715,50 +719,62 @@ def item(self):
715719

716720
@property
717721
def data(self):
718-
""" return the data pointer of the underlying data """
722+
"""
723+
Return the data pointer of the underlying data.
724+
"""
719725
warnings.warn("{obj}.data is deprecated and will be removed "
720726
"in a future version".format(obj=type(self).__name__),
721727
FutureWarning, stacklevel=2)
722728
return self.values.data
723729

724730
@property
725731
def itemsize(self):
726-
""" return the size of the dtype of the item of the underlying data """
732+
"""
733+
Return the size of the dtype of the item of the underlying data.
734+
"""
727735
warnings.warn("{obj}.itemsize is deprecated and will be removed "
728736
"in a future version".format(obj=type(self).__name__),
729737
FutureWarning, stacklevel=2)
730738
return self._ndarray_values.itemsize
731739

732740
@property
733741
def nbytes(self):
734-
""" return the number of bytes in the underlying data """
742+
"""
743+
Return the number of bytes in the underlying data.
744+
"""
735745
return self._values.nbytes
736746

737747
@property
738748
def strides(self):
739-
""" return the strides of the underlying data """
749+
"""
750+
Return the strides of the underlying data.
751+
"""
740752
warnings.warn("{obj}.strides is deprecated and will be removed "
741753
"in a future version".format(obj=type(self).__name__),
742754
FutureWarning, stacklevel=2)
743755
return self._ndarray_values.strides
744756

745757
@property
746758
def size(self):
747-
""" return the number of elements in the underlying data """
759+
"""
760+
Return the number of elements in the underlying data.
761+
"""
748762
return self._values.size
749763

750764
@property
751765
def flags(self):
752-
""" return the ndarray.flags for the underlying data """
766+
"""
767+
Return the ndarray.flags for the underlying data.
768+
"""
753769
warnings.warn("{obj}.flags is deprecated and will be removed "
754770
"in a future version".format(obj=type(self).__name__),
755771
FutureWarning, stacklevel=2)
756772
return self.values.flags
757773

758774
@property
759775
def base(self):
760-
""" return the base object if the memory of the underlying data is
761-
shared
776+
"""
777+
Return the base object if the memory of the underlying data is shared.
762778
"""
763779
warnings.warn("{obj}.base is deprecated and will be removed "
764780
"in a future version".format(obj=type(self).__name__),
@@ -818,7 +834,7 @@ def max(self):
818834

819835
def argmax(self, axis=None):
820836
"""
821-
return a ndarray of the maximum argument indexer
837+
Return a ndarray of the maximum argument indexer.
822838
823839
See Also
824840
--------
@@ -861,7 +877,7 @@ def min(self):
861877

862878
def argmin(self, axis=None):
863879
"""
864-
return a ndarray of the minimum argument indexer
880+
Return a ndarray of the minimum argument indexer.
865881
866882
See Also
867883
--------
@@ -900,7 +916,9 @@ def __iter__(self):
900916

901917
@cache_readonly
902918
def hasnans(self):
903-
""" return if I have any nans; enables various perf speedups """
919+
"""
920+
Return if I have any nans; enables various perf speedups.
921+
"""
904922
return bool(isna(self).any())
905923

906924
def _reduce(self, op, name, axis=0, skipna=True, numeric_only=None,

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2342,7 +2342,7 @@ def to_hdf(self, path_or_buf, key, **kwargs):
23422342

23432343
def to_msgpack(self, path_or_buf=None, encoding='utf-8', **kwargs):
23442344
"""
2345-
msgpack (serialize) object to input file path
2345+
Serialize object to input file path using msgpack format.
23462346
23472347
THIS IS AN EXPERIMENTAL LIBRARY and the storage format
23482348
may not be stable until a future release.

pandas/core/indexes/base.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2250,7 +2250,9 @@ def _nan_idxs(self):
22502250

22512251
@cache_readonly
22522252
def hasnans(self):
2253-
""" return if I have any nans; enables various perf speedups """
2253+
"""
2254+
Return if I have any nans; enables various perf speedups.
2255+
"""
22542256
if self._can_hold_na:
22552257
return bool(self._isnan.any())
22562258
else:

pandas/core/indexes/datetimelike.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class TimelikeOps(object):
8080

8181
_round_doc = (
8282
"""
83-
{op} the data to the specified `freq`.
83+
Perform {op} operation on the data to the specified `freq`.
8484
8585
Parameters
8686
----------

pandas/core/series.py

+23-11
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
118118
Parameters
119119
----------
120120
data : array-like, Iterable, dict, or scalar value
121-
Contains data stored in Series
121+
Contains data stored in Series.
122122
123123
.. versionchanged :: 0.23.0
124124
If data is a dict, argument order is maintained for Python 3.6
@@ -133,8 +133,8 @@ class Series(base.IndexOpsMixin, generic.NDFrame):
133133
dtype : str, numpy.dtype, or ExtensionDtype, optional
134134
dtype for the output Series. If not specified, this will be
135135
inferred from `data`.
136-
copy : boolean, default False
137-
Copy input data
136+
copy : bool, default False
137+
Copy input data.
138138
"""
139139
_metadata = ['name']
140140
_accessors = {'dt', 'cat', 'str', 'sparse'}
@@ -389,22 +389,30 @@ def name(self, value):
389389
# ndarray compatibility
390390
@property
391391
def dtype(self):
392-
""" return the dtype object of the underlying data """
392+
"""
393+
Return the dtype object of the underlying data.
394+
"""
393395
return self._data.dtype
394396

395397
@property
396398
def dtypes(self):
397-
""" return the dtype object of the underlying data """
399+
"""
400+
Return the dtype object of the underlying data.
401+
"""
398402
return self._data.dtype
399403

400404
@property
401405
def ftype(self):
402-
""" return if the data is sparse|dense """
406+
"""
407+
Return if the data is sparse|dense.
408+
"""
403409
return self._data.ftype
404410

405411
@property
406412
def ftypes(self):
407-
""" return if the data is sparse|dense """
413+
"""
414+
Return if the data is sparse|dense.
415+
"""
408416
return self._data.ftype
409417

410418
@property
@@ -441,7 +449,9 @@ def values(self):
441449

442450
@property
443451
def _values(self):
444-
""" return the internal repr of this data """
452+
"""
453+
Return the internal repr of this data.
454+
"""
445455
return self._data.internal_values()
446456

447457
def _formatting_values(self):
@@ -451,7 +461,9 @@ def _formatting_values(self):
451461
return self._data.formatting_values()
452462

453463
def get_values(self):
454-
""" same as values (but handles sparseness conversions); is a view """
464+
"""
465+
Same as values (but handles sparseness conversions); is a view.
466+
"""
455467
return self._data.get_values()
456468

457469
@property
@@ -3482,9 +3494,9 @@ def rename(self, index=None, **kwargs):
34823494
the index.
34833495
Scalar or hashable sequence-like will alter the ``Series.name``
34843496
attribute.
3485-
copy : boolean, default True
3497+
copy : bool, default True
34863498
Also copy underlying data
3487-
inplace : boolean, default False
3499+
inplace : bool, default False
34883500
Whether to return a new Series. If True then value of copy is
34893501
ignored.
34903502
level : int or level name, default None

0 commit comments

Comments
 (0)