Skip to content

BUG: RecursionError shifting a Series with bytes datatype #52373

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

Open
2 of 3 tasks
atpage opened this issue Apr 3, 2023 · 0 comments
Open
2 of 3 tasks

BUG: RecursionError shifting a Series with bytes datatype #52373

atpage opened this issue Apr 3, 2023 · 0 comments
Labels
Astype Bug Series Series data structure

Comments

@atpage
Copy link

atpage commented Apr 3, 2023

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

series = pd.Series(
    ['a','b','c','d']
).astype(bytes)

series.shift(1)  # will fail with RecursionError

Issue Description

pandas.Series.shift() works for me in most cases, but not with the bytes datatype used in the example, or with numpy equivalent types (e.g. np.dtype('aN')).

Expected Behavior

series.shift(1) should return [None, 'a', 'b', 'c'] in the example, probably changing the dtype to object to accommodate None.

Installed Versions

INSTALLED VERSIONS

commit : 8dab54d
python : 3.10.6.final.0
python-bits : 64
OS : Linux
OS-release : 5.19.3-051903-generic
Version : #202208211442 SMP PREEMPT_DYNAMIC Sun Aug 21 14:54:49 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.5.2
numpy : 1.21.5
pytz : 2022.1
dateutil : 2.8.2
setuptools : 59.6.0
pip : 23.0.1
Cython : 0.29.32
pytest : 7.1.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.8.0
html5lib : 1.1
pymysql : None
psycopg2 : 2.9.3
jinja2 : 3.0.3
IPython : 8.4.0
pandas_datareader: None
bs4 : 4.10.0
bottleneck : None
brotli : 1.0.9
fastparquet : None
fsspec : 2022.7.1
gcsfs : None
matplotlib : 3.5.1
numba : 0.56.0
numexpr : None
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.8.0
snappy : None
sqlalchemy : 1.4.44
tables : None
tabulate : 0.8.10
xarray : None
xlrd : 1.2.0
xlwt : None
zstandard : None
tzdata : None

@atpage atpage added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 3, 2023
@DeaMariaLeon DeaMariaLeon added Series Series data structure Astype and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Astype Bug Series Series data structure
Projects
None yet
Development

No branches or pull requests

2 participants