Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 0 additions & 3 deletions doc/_templates/pandas_footer.html

This file was deleted.

2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@

html_theme_options = {
"external_links": [],
"footer_start": ["pandas_footer", "sphinx-version"],
"footer_start": ["copyright"],
"github_url": "https://github.com/pandas-dev/pandas",
"analytics": {
"plausible_analytics_domain": "pandas.pydata.org",
Expand Down
23 changes: 23 additions & 0 deletions pandas/core/strings/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,12 @@ def cat(
alignment, use `.values` on any Series/Index/DataFrame in `others`.

Returns
-------
When concatenating with a Series or Index, pandas aligns on index labels
by default. This can produce NaN values if the indices do not match.
To get element-wise concatenation (the behavior before v0.23),
convert the object to numpy arrays with ``.values`` or ``.to_numpy()``.

-------
str, Series or Index
If `others` is None, `str` is returned, otherwise a `Series/Index`
Expand Down Expand Up @@ -613,6 +619,23 @@ def cat(
4 -e
2 -c
dtype: str
Examples with Index
-------------------
>>> idx = pd.Index(["a", "b", "c"])
>>> ser = pd.Series(["x", "y", "z"])

# Default alignment behavior (indices match here)
>>> idx.str.cat(ser, join="left")
Index(['ax', 'by', 'cz'], dtype='object')

# If indices do not match, result may contain NaN
>>> ser2 = pd.Series(["x", "y", "z"], index=[10, 11, 12])
>>> idx.str.cat(ser2, join="left")
Index([nan, nan, nan], dtype='object')

# Element-wise concatenation (old behavior) using .values
>>> idx.str.cat(ser.values)
Index(['ax', 'by', 'cz'], dtype='object')

For more examples, see :ref:`here <text.concatenate>`.
"""
Expand Down
Loading