8000 PERF: StringArray construction by topper-123 · Pull Request #36325 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

PERF: StringArray construction #36325

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

Merged
merged 4 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
add issue number
  • Loading branch information
topper-123 committed Sep 16, 2020
commit f1721ac58773e94d754ffda045102edb9713c92a
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v1.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ Deprecations
Performance improvements
~~~~~~~~~~~~~~~~~~~~~~~~

- Performance improvements when creating Series with dtype `str` or :class:`StringDtype` from array with many string elements (:issue:`36304`, :issue:`36317`)
- Performance improvements when creating Series with dtype `str` or :class:`StringDtype` from array with many string elements (:issue:`36304`, :issue:`36317`, :issue:`36325`)
- Performance improvement in :meth:`GroupBy.agg` with the ``numba`` engine (:issue:`35759`)
- Performance improvements when creating :meth:`pd.Series.map` from a huge dictionary (:issue:`34717`)
- Performance improvement in :meth:`GroupBy.transform` with the ``numba`` engine (:issue:`36240`)
Expand Down
8 changes: 4 additions & 4 deletions pandas/core/arrays/string_.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@ class StringArray(PandasArray):
['1', '1']
Length: 2, dtype: string

Instantiating StringArrays directly with non-strings will raise an error unless
``convert=True``.
Instantiating StringArrays directly with non-strings arrays will raise an error
unless ``convert=True``.

>>> pd.arrays.StringArray(['1', 1])
TypeError: Argument 'values' has incorrect type (expected numpy.ndarray, got list)
>>> pd.arrays.StringArray(np.array(['1', 1], dtype=object))
ValueError: StringArray requires a sequence of strings or pandas.NA
>>> pd.arrays.StringArray(['1', 1], convert=True)
<StringArray>
['1', '1']
Expand Down
0