-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
value_counts not working correctly on (some?) ExtensionArrays #33172
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
For the Int64 case
on 0.25.3
8bdd7b1 is the first bad commit
#30824 made changes to masked extension arrays, so assume behaviour of other extension arrays is not impacted.
|
this is fixed on master, xref #33538, just needs tests.
|
@simonjayhawkins On which version we should have the tests? I can work on this one. I will try 0.26.x, 0.25.x, and 1.1.x and report back here. I guess we also need unittest right? |
take |
looks like @kotamatsuoka is working on the unit tests. I will wait and see. |
Code Sample
Problem description
The problem seems to be that
value_counts()
on a string extension dtype returns an Int64 dtype, andsum
is not implemented for IntegerArrays , although it is for Series with ExtensionArrays:Expected Output
May be related to #22843?
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.6.final.0
python-bits : 64
OS : Darwin
OS-release : 19.2.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.UTF-8
pandas : 1.0.3
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.0
pip : 20.0.2
setuptools : 46.1.1.post20200322
Cython : None
pytest : 5.4.1
hypothesis : None
sphinx : 2.4.4
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.5.0
html5lib : None
pymysql : 0.9.3
psycopg2 : 2.8.4 (dt dec pq3 ext lo64)
jinja2 : 2.11.1
IPython : 7.13.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : 4.5.0
matplotlib : 3.2.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.16.0
pytables : None
pytest : 5.4.1
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : 1.3.15
tables : None
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : None
numba : 0.48.0
The text was updated successfully, but these errors were encountered: