-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
API: Series.str-accessor infers dtype (and Index.str does not raise on all-NA) #23167
Changes from 19 commits
e377b69
88b7b53
b19a40d
fb7da6b
f8ffb0d
4404d4f
4aedad4
1285fd5
332d14b
8716394
44a9146
e34097f
25a046c
9307ba1
c9c7496
0e0f6b0
bf4d7cf
a68ea5f
5ae1533
b8f6792
0c7e233
1168ca2
ab980ec
a996889
4adef35
f62e344
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,6 +152,42 @@ returned if all the columns were dummy encoded, and a :class:`DataFrame` otherwi | |
Providing any ``SparseSeries`` or ``SparseDataFrame`` to :func:`concat` will | ||
cause a ``SparseSeries`` or ``SparseDataFrame`` to be returned, as before. | ||
|
||
The ``.str``-accessor performs stricter type checks | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Due to the lack of a native string dtype in numpy, :attr:`Series.str` only checked whether the data was of ``object`` dtype. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reword this in a more positive light. (basically remove up thru numpy) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add the issues that are being closed here (before the examples) |
||
From now on, the inferred dtype of the Series is checked to be correct (particularly, not ``'bytes'``), as :attr:`Index.str` does already. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
*Previous Behaviour*: | ||
|
||
.. code-block:: python | ||
|
||
In [1]: s = pd.Series(np.array(['a', 'ba', 'cba'], 'S'), dtype=object) | ||
|
||
In [2]: s | ||
Out[2]: | ||
0 b'a' | ||
1 b'ba' | ||
2 b'cba' | ||
dtype: object | ||
|
||
In [3]: s.str.startswith(b'a') | ||
Out[3]: | ||
0 True | ||
1 False | ||
2 False | ||
dtype: bool | ||
|
||
*New Behaviour*: | ||
|
||
.. ipython:: python | ||
:okexcept: | ||
|
||
s = pd.Series(np.array(['a', 'ba', 'cba'], 'S'), dtype=object) | ||
s | ||
s.str.startswith(b'a') | ||
|
||
For more details, see this :ref:`warning<text.warn_types>`. | ||
|
||
.. _whatsnew_0250.api_breaking.deps: | ||
|
||
|
@@ -321,7 +357,7 @@ Conversion | |
Strings | ||
^^^^^^^ | ||
|
||
- | ||
- Bug in the ``__name__`` attribute of several methods of :class:`Series.str`, which were set incorrectly (:issue:`23551`) | ||
- | ||
- | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove what you have in the parens (like it...)