8000 Fixed docstrings as referenced in issue no: #24071 by killerontherun1 · Pull Request #26520 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Fixed docstrings as referenced in issue no: #24071 #26520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 65 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
62deebc
Fixed docstrings as referenced in issue no: #24071
May 25, 2019
129b40c
CLN: remove __bytes__ (#26447)
topper-123 May 19, 2019
60d2438
BUG: Fix #25959 - Don't call .array in DatetimeLikeArrayMixin's map (…
ThomasKluiters May 19, 2019
843d372
DEPR: Change .ix DeprecationWarning -> FutureWarning (#26438)
jorisvandenbossche May 19, 2019
81ad35d
BUG: bugfix 26390 assigning PandasArray to DataFrame error (#26417)
shantanu-gontia May 19, 2019
a141cc5
BUG: fix calling local references with keyword arguments in query (#2…
danielhrisca May 19, 2019
5a8aad7
TST/DEPR: remove .ix from tests\indexing\multiindex\test_loc.py (#26451)
simonjayhawkins May 19, 2019
e3af0ce
BUG: ngroups and len(groups) do not equal when grouping with a list o…
shantanu-gontia May 20, 2019
323eb5e
BUG-20629 allow .at accessor with CategoricalIndex (#26298)
JustinZhengBC May 20, 2019
a5ce533
BUG: Exception when frame constructed from dict of iterators (#26356)
topper-123 May 20, 2019
f294d30
Add defensive check for argument errors keyword in to_numeric (#26466)
sumanau7 May 20, 2019
e98df14
DOC: fix example with Timestamp/integer addition (#26467)
jorisvandenbossche May 20, 2019
9fb07d6
DOC: whatsnew fixes
gfyoung May 20, 2019
1f6a751
DOC: #25723 passing kwargs to excel document engine (#26465)
Dunni3 May 20, 2019
198f7b8
DEPR: deprecate SparseArray.values (#26421)
jorisvandenbossche May 21, 2019
9712c2e
ENH - Index set operation modifications to address issue #23525 (#23538)
ms7463 May 21, 2019
6879e25
DOC/CLN: wil -> will (#26484)
simonjayhawkins May 21, 2019
be6d194
Fixed typo mutiplication -> multiplication. (#26489)
javabrett May 22, 2019
fbdea8c
DOC: fix SyntaxError in doc build on Windows (#26499)
simonjayhawkins May 23, 2019
8eb0c08
DOC: Highlighted role of index alignment in DataFrame.dot(other) (#26…
matsmaiwald May 23, 2019
b8d46a4
DOC/CLN: Change API reference section title (#26486)
simonjayhawkins May 24, 2019
736d2c5
CLN: Remove StringMixin from PandasObject (#26505)
topper-123 May 24, 2019
81acbef
Fix type annotations in pandas.core.indexes.datetimes (#26404)
vaibhavhrt May 24, 2019
4fa2a28
Better error message for DataFrame.hist() without numerical columns (…
matsmaiwald May 24, 2019
385fced
Excel Test Cleanup - ReadWriteClass (#26473)
WillAyd May 24, 2019
5cc13b5
CLN: pd.TimeGrouper (#26477)
mroeschke May 24, 2019
b72832d
CLN: Remove ExcelWriter.sheetname (#26464)
mroeschke May 25, 2019
3e32dcd
Merge branch 'master' into docstring_fix
May 25, 2019
67ebeb9
Fixed GL01 and GL02 in pandas.api
May 26, 2019
3b57213
GL01 and GL02 solved for pandas.eval
May 26, 2019
c9d2fb5
solved GL01 GL02 for pandas.HDFStore
May 26, 2019
0341bf4
solved GL01 GL02 for pandas.Index.T
May 26, 2019
dbbf44d
Fixed GL01 and GL02 in pandas.api
May 26, 2019
19fd64b
GL01 and GL02 solved for pandas.eval
May 26, 2019
f00abcf
solved GL01 GL02 for pandas.HDFStore
May 26, 2019
9dbf25f
CLN: remove __bytes__ (#26447)
topper-123 May 19, 2019
526c4df
BUG: Fix #25959 - Don't call .array in DatetimeLikeArrayMixin's map (…
ThomasKluiters May 19, 2019
612dc08
DEPR: Change .ix DeprecationWarning -> FutureWarning (#26438)
jorisvandenbossche May 19, 2019
62aee5a
BUG: bugfix 26390 assigning PandasArray to DataFrame error (#26417)
shantanu-gontia May 19, 2019
7b33e85
BUG: fix calling local references with keyword arguments in query (#2…
danielhrisca May 19, 2019
d69b8ce
TST/DEPR: remove .ix from tests\indexing\multiindex\test_loc.py (#26451)
simonjayhawkins May 19, 2019
c648673
BUG: ngroups and len(groups) do not equal when grouping with a list o…
shantanu-gontia May 20, 2019
5861fc9
BUG-20629 allow .at accessor with CategoricalIndex (#26298)
JustinZhengBC May 20, 2019
b68ca02
BUG: Exception when frame constructed from dict of iterators (#26356)
topper-123 May 20, 2019
c2d13dc
Add defensive check for argument errors keyword in to_numeric (#26466)
sumanau7 May 20, 2019
e588b69
DOC: fix example with Timestamp/integer addition (#26467)
jorisvandenbossche May 20, 2019
39b4db2
DOC: whatsnew fixes
gfyoung May 20, 2019
e1af4aa
DOC: #25723 passing kwargs to excel document engine (#26465)
Dunni3 May 20, 2019
0eb589b
DEPR: deprecate SparseArray.values (#26421)
jorisvandenbossche May 21, 2019
407eee1
ENH - Index set operation modifications to address issue #23525 (#23538)
ms7463 May 21, 2019
dbe8837
DOC/CLN: wil -> will (#26484)
simonjayhawkins May 21, 2019
35d517d
Fixed typo mutiplication -> multiplication. (#26489)
javabrett May 22, 2019
0b28ddf
DOC: fix SyntaxError in doc build on Windows (#26499)
simonjayhawkins May 23, 2019
b3c191a
DOC: Highlighted role of index alignment in DataFrame.dot(other) (#26…
matsmaiwald May 23, 2019
c75f08f
DOC/CLN: Change API reference section title (#26486)
simonjayhawkins May 24, 2019
030240f
CLN: Remove StringMixin from PandasObject (#26505)
topper-123 May 24, 2019
6105c62
Fix type annotations in pandas.core.indexes.datetimes (#26404)
vaibhavhrt May 24, 2019
1eca8b7
Better error message for DataFrame.hist() without numerical columns (…
matsmaiwald May 24, 2019
5e2b989
Excel Test Cleanup - ReadWriteClass (#26473)
WillAyd May 24, 2019
ea8822c
CLN: pd.TimeGrouper (#26477)
mroeschke May 24, 2019
c1cbc6d
CLN: Remove ExcelWriter.sheetname (#26464)
mroeschke May 25, 2019
d122189
GL01 and GL02 solved for pandas.eval
May 26, 2019
32211fc
solved GL01 GL02 for pandas.Index.T
May 26, 2019
15f1fa3
Merge branch 'docstring_fix' of https://github.com/killerontherun1/pa…
May 26, 2019
3d10423
Revert "Fixed docstrings as referenced in issue no: #24071"
May 26, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
Prev Previous commit
Next Next commit
CLN: Remove StringMixin from PandasObject (#26505)
  • Loading branch information
topper-123 authored and Mathew George committed May 26, 2019
commit 030240f0f253ad881b72a152bce5f461c4f81bee
14 changes: 14 additions & 0 deletions doc/source/whatsnew/v0.25.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,20 @@ are returned. (:issue:`21521`)
df.groupby("a").ffill()


``__str__`` methods now call ``__repr__`` rather than vica-versa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Pandas has until now mostly defined string representations in a Pandas objects's
``__str__``/``__unicode__``/``__bytes__`` methods, and called ``__str__`` from the ``__repr__``
method, if a specific ``__repr__`` method is not found. This is not needed for Python3.
In Pandas 0.25, the string representations of Pandas objects are now generally
defined in ``__repr__``, and calls to ``__str__`` in general now pass the call on to
the ``__repr__``, if a specific ``__str__`` method doesn't exist, as is standard for Python.
This change is backward compatible for direct usage of Pandas, but if you subclass
Pandas objects *and* give your subclasses specific ``__str__``/``__repr__`` methods,
you may have to adjust your ``__str__``/``__repr__`` methods (:issue:`26495`).


.. _whatsnew_0250.api_breaking.deps:

Increased minimum versions for dependencies
Expand Down
6 changes: 1 addition & 5 deletions pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,7 @@ def _get_repr(self, length=True, na_rep='NaN', footer=True):
result = formatter.to_string()
return str(result)

def __str__(self):
def __repr__(self):
"""
String representation.
"""
Expand All @@ -2037,10 +2037,6 @@ def __str__(self):

return result

def __repr__(self):
# We want to bypass the ExtensionArray.__repr__
return str(self)

def _maybe_coerce_indexer(self, indexer):
"""
return an indexer coerced to the codes dtype
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,7 @@ def _add_comparison_ops(cls):
# ----------
# Formatting
# -----------
def __str__(self):
def __repr__(self):
return '{self}\nFill: {fill}\n{index}'.format(
self=printing.pprint_thing(self),
fill=printing.pprint_thing(self.fill_value),
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/base.py
8000
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __repr__(self):
return str(self)


class PandasObject(StringMixin, DirNamesMixin):
class PandasObject(DirNamesMixin):

"""baseclass for various pandas objects"""

Expand All @@ -64,7 +64,7 @@ def _constructor(self):
"""class constructor (for this class it's just `__class__`"""
return self.__class__

def __str__(self):
def __repr__(self):
"""
Return a string representation for a particular object.
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def _info_repr(self):
return info_repr_option and not (self._repr_fits_horizontal_() and
self._repr_fits_vertical_())

def __str__(self):
def __repr__(self):
"""
Return a string representation for a particular DataFrame.
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,7 @@ def __setstate__(self, state):
# ----------------------------------------------------------------------
# Rendering Methods

def __str__(self):
def __repr__(self):
# string representation based upon iterating over self
# (since, by definition, `PandasContainers` are iterable)
prepr = '[%s]' % ','.join(map(pprint_thing, self))
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ def __init__(self, obj, keys=None, axis=0, level=None,
def __len__(self):
return len(self.groups)

def __str__(self):
# TODO: Better str/repr for GroupBy object
def __repr__(self):
# TODO: Better repr for GroupBy object
return object.__repr__(self)

def _assure_grouper(self):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ def __deepcopy__(self, memo=None):
# --------------------------------------------------------------------
# Rendering Methods

def __str__(self):
def __repr__(self):
"""
Return a string representation for this object.
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/frozen.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def values(self):
arr = self.view(np.ndarray).copy()
return arr

def __str__(self):
def __repr__(self):
"""
Return a string representation for this object.
"""
Expand Down
3 changes: 1 addition & 2 deletions pandas/core/internals/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ def make_block_same_class(self, values, placement=None, ndim=None,
return make_block(values, placement=placement, ndim=ndim,
klass=self.__class__, dtype=dtype)

def __str__(self):

def __repr__(self):
# don't want to print out all of the items here
name = pprint_thing(self.__class__.__name__)
if self._is_single_block:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/internals/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def _post_setstate(self):
def __len__(self):
return len(self.items)

def __str__(self):
def __repr__(self):
output = pprint_thing(self.__class__.__name__)
for i, ax in enumerate(self.axes):
if i == 0:
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def _compare_constructor(self, other, func):
# ----------------------------------------------------------------------
# Magic methods

def __str__(self):
def __repr__(self):
"""
Return a string representation for a particular Panel.
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ def reset_index(self, level=None, drop=False, name=None, inplace=False):
# ----------------------------------------------------------------------
# Rendering Methods

def __str__(self):
def __repr__(self):
"""
Return a string representation for a particular Series.
"""
Expand Down
5 changes: 2 additions & 3 deletions pandas/core/sparse/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,8 @@ def as_sparse_array(self, kind=None, fill_value=None, copy=False):
return SparseArray(self.values, sparse_index=self.sp_index,
fill_value=fill_value, kind=kind, copy=copy)

def __str__(self):
# currently, unicode is same as repr...fixes infinite loop
series_rep = Series.__str__(self)
def __repr__(self):
series_rep = Series.__repr__(self)
rep = '{series}\n{index!r}'.format(series=series_rep,
index=self.sp_index)
return rep
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def _get_window(self, other=None):
def _window_type(self):
return self.__class__.__name__

def __str__(self):
def __repr__(self):
"""
Provide a nice str repr of our rolling object.
"""
Expand Down
0