From a7d35580e36dc7131a09df168075a646024fb1af Mon Sep 17 00:00:00 2001 From: SrushtikShetty Date: Sat, 30 Aug 2025 09:27:33 +0530 Subject: [PATCH 1/3] simplify docs footer by using theme config instead of custom template --- doc/_templates/pandas_footer.html | 3 --- doc/source/conf.py | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 doc/_templates/pandas_footer.html diff --git a/doc/_templates/pandas_footer.html b/doc/_templates/pandas_footer.html deleted file mode 100644 index 6d8caa4d6c741..0000000000000 --- a/doc/_templates/pandas_footer.html +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/doc/source/conf.py b/doc/source/conf.py index f222a228531ff..03e8127818f94 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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", From ec2e8914d99d20f55c82b97798de72c23d660812 Mon Sep 17 00:00:00 2001 From: SrushtikShetty Date: Sat, 30 Aug 2025 10:12:20 +0530 Subject: [PATCH 2/3] clarify .str.cat behavior with Index/Series --- pandas/core/strings/accessor.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pandas/core/strings/accessor.py b/pandas/core/strings/accessor.py index 21e6e2efbe778..df31704576ddb 100644 --- a/pandas/core/strings/accessor.py +++ b/pandas/core/strings/accessor.py @@ -527,6 +527,13 @@ def cat( alignment, use `.values` on any Series/Index/DataFrame in `others`. Returns + Notes + ----- + 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` @@ -613,6 +620,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 `. """ From 62c4ede26a336744e09bde9f6ef562154c1e792f Mon Sep 17 00:00:00 2001 From: SrushtikShetty Date: Sat, 30 Aug 2025 10:40:14 +0530 Subject: [PATCH 3/3] clarify .str.cat behavior with Index/Series --- pandas/core/strings/accessor.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/core/strings/accessor.py b/pandas/core/strings/accessor.py index df31704576ddb..7cc88f6705066 100644 --- a/pandas/core/strings/accessor.py +++ b/pandas/core/strings/accessor.py @@ -527,8 +527,7 @@ def cat( alignment, use `.values` on any Series/Index/DataFrame in `others`. Returns - Notes - ----- + ------- 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),