Skip to content

Commit 593605f

Browse files
AminooZproost
authored andcommitted
Pandas.series.astype docstring PR02 (pandas-dev#28340)
1 parent 9ddf3dd commit 593605f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/generic.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5780,11 +5780,11 @@ def astype(self, dtype, copy=True, errors="raise", **kwargs):
57805780
Control raising of exceptions on invalid data for provided dtype.
57815781
57825782
- ``raise`` : allow exceptions to be raised
5783-
- ``ignore`` : suppress exceptions. On error return original object
5783+
- ``ignore`` : suppress exceptions. On error return original object.
57845784
57855785
.. versionadded:: 0.20.0
57865786
5787-
kwargs : keyword arguments to pass on to the constructor
5787+
**kwargs : keyword arguments to pass on to the constructor
57885788
57895789
Returns
57905790
-------
@@ -5845,7 +5845,7 @@ def astype(self, dtype, copy=True, errors="raise", **kwargs):
58455845
Convert to ordered categorical type with custom ordering:
58465846
58475847
>>> cat_dtype = pd.api.types.CategoricalDtype(
5848-
... categories=[2, 1], ordered=True)
5848+
... categories=[2, 1], ordered=True)
58495849
>>> ser.astype(cat_dtype)
58505850
0 1
58515851
1 2
@@ -5855,7 +5855,7 @@ def astype(self, dtype, copy=True, errors="raise", **kwargs):
58555855
Note that using ``copy=False`` and changing data on a new
58565856
pandas object may propagate changes:
58575857
5858-
>>> s1 = pd.Series([1,2])
5858+
>>> s1 = pd.Series([1, 2])
58595859
>>> s2 = s1.astype('int64', copy=False)
58605860
>>> s2[0] = 10
58615861
>>> s1 # note that s1[0] has changed too

0 commit comments

Comments
 (0)