You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
importpandasaspd# when run in debug modedata=dict(x=[1, 2, 3], y=[np.nan, 2, 4], z=[5.345, np.nan, 9.0])
df=pd.DataFrame(data).stack()
df=df.unstack()
Issue Description
When de-bugging python 3.10+ (tested on 3.10.4) several functions, including unstack and pivot will raise TypeError 'NoneType'. Problem only exists in debug mode and code works fine when in production or run as a script.
Search the forums seems this may be to do with the way Numpy is interacting with Cython; tested using Numpy 1.22.3 and Cython 0.29.29 and 0.29.30.
Full traceback:
Traceback (most recent call last):
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\numpy\core\getlimits.py", line 649, in init
self.dtype = numeric.dtype(int_type)
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2022.1.1\plugins\python\helpers\pydev\pydevd.py", line 1491, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2022.1.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/XXX/Documents/GitHub/XXX/playground.py", line 9, in
df = df.unstack()
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\pandas\core\series.py", line 4157, in unstack
return unstack(self, level, fill_value)
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\pandas\core\reshape\reshape.py", line 491, in unstack
unstacker = _Unstacker(
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\pandas\core\reshape\reshape.py", line 133, in init
if num_cells > np.iinfo(np.int32).max:
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\numpy\core\getlimits.py", line 651, in init
self.dtype = numeric.dtype(type(int_type))
TypeError: 'NoneType' object is not callable
python-BaseException
Expected Behavior
Should simply unstack dataframe
Installed Versions
pd.show_versions() just throws
AssertionError: C:\Users\T333208.conda\envs\py10\lib\distutils\core.py
when running python 3.10.4, pandas 1.4.2
The text was updated successfully, but these errors were encountered:
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
Issue Description
When de-bugging python 3.10+ (tested on 3.10.4) several functions, including unstack and pivot will raise TypeError 'NoneType'. Problem only exists in debug mode and code works fine when in production or run as a script.
Search the forums seems this may be to do with the way Numpy is interacting with Cython; tested using Numpy 1.22.3 and Cython 0.29.29 and 0.29.30.
Full traceback:
Traceback (most recent call last):
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\numpy\core\getlimits.py", line 649, in init
self.dtype = numeric.dtype(int_type)
TypeError: 'NoneType' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2022.1.1\plugins\python\helpers\pydev\pydevd.py", line 1491, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2022.1.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/XXX/Documents/GitHub/XXX/playground.py", line 9, in
df = df.unstack()
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\pandas\core\series.py", line 4157, in unstack
return unstack(self, level, fill_value)
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\pandas\core\reshape\reshape.py", line 491, in unstack
unstacker = _Unstacker(
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\pandas\core\reshape\reshape.py", line 133, in init
if num_cells > np.iinfo(np.int32).max:
File "C:\Users\XXX.conda\envs\py10\lib\site-packages\numpy\core\getlimits.py", line 651, in init
self.dtype = numeric.dtype(type(int_type))
TypeError: 'NoneType' object is not callable
python-BaseException
Expected Behavior
Should simply unstack dataframe
Installed Versions
pd.show_versions() just throws
AssertionError: C:\Users\T333208.conda\envs\py10\lib\distutils\core.py
when running python 3.10.4, pandas 1.4.2
The text was updated successfully, but these errors were encountered: