-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Series#rename(str) change the name of Series. #17407
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
Comments
pls read the doc-string. you are renaming to a callable which is valid but weird. you generally need to use a string.
|
@jreback |
this is clearly documented and does not interact with the index. |
I think this is a bug. |
@Eastsun changing the check in |
…17407) (#17654) * BUG: Fix series rename called with str altering the name. GH17407 * add whatsnew for the fix for #17407 * Fix typo in whatsnew * remove whitespace * Update code after @jreback's comments * Change `or` to `and` for checking iterable * Only check against Iterable in is_list_like and add test for `str` * Update v0.21.0.txt
…17407) (pandas-dev#17654) * BUG: Fix series rename called with str altering the name. GH17407 * add whatsnew for the fix for pandas-dev#17407 * Fix typo in whatsnew * remove whitespace * Update code after @jreback's comments * Change `or` to `and` for checking iterable * Only check against Iterable in is_list_like and add test for `str` * Update v0.21.0.txt
…17407) (pandas-dev#17654) * BUG: Fix series rename called with str altering the name. GH17407 * add whatsnew for the fix for pandas-dev#17407 * Fix typo in whatsnew * remove whitespace * Update code after @jreback's comments * Change `or` to `and` for checking iterable * Only check against Iterable in is_list_like and add test for `str` * Update v0.21.0.txt
Code Sample, a copy-pastable example if possible
Problem description
I deep into the code and find that pandas.core.series#is_list_like return True for str:
The implementation of is_list_like:
may should change to:
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.2.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.20.3
pytest: 3.2.1
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.26
numpy: 1.13.1
scipy: 0.19.1
xarray: None
IPython: 6.1.0
sphinx: 1.6.3
patsy: 0.4.1
dateutil: 2.6.1
The text was updated successfully, but these errors were encountered: