-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG: exception raised on subclassed DataFrame when calling _dispatch_frame_op #43201
Comments
Thanks @leobrl for the report.
makes sense. DataFrame._dispatch_frame_op was added in #37044 cc @jbrockmendel |
yes The example might be a good use case for .attrs |
`
mydf_sub = mydf[['A','C']]
` |
There is an active discussion on this. see #32638 (comment) |
[ x ] I have checked that this issue has not already been reported.
[ x ] I have confirmed this bug exists on the latest version of pandas.
[ x ] (optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
This code raises an exception, ultimately because function
_dispatch_frame_op
in \pandas\core\frame.py returnstype(self)(bm)
. Shouldn't instead returnself._constructor(bm)
?Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 5f648bf
python : 3.8.10.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-81-generic
Version : #91-Ubuntu SMP Thu Jul 15 19:09:17 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 1.3.2
numpy : 1.20.1
pytz : 2019.3
dateutil : 2.7.3
pip : 21.0.1
setuptools : 45.2.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.21.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.4
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.6.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: