Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
_combine_const() in pandas.sparse.frame does not have uniform method signature with pandas.core.frame #13001
Comments
|
yeah guess we don't actually have an issue for this. |
jreback
added Bug API Design Sparse Difficulty Intermediate Effort Low
labels
Apr 26, 2016
jreback
added this to the
0.18.2
milestone
Apr 26, 2016
|
pull-requests welcome! |
Ritaja
commented
Apr 27, 2016
•
|
I was thinking of working on this, however I have a small doubt: I noticed that usage:in method In scope of the current scenario, it would work to use Any help is appreciated :) |
|
sparse does not have too much support for many dtypes atm; its not very general. but it is moving in the right directlion mostly by @sinhrks. you are delving into a deep dark area of pandas. |
Ritaja
commented
Apr 27, 2016
|
@jreback I see. So how would you advice to address the current scenario, bypassing a complete solution for |
|
I think @sinhrks would have better short-term advice. |
|
I think we should have Until then, adding more tests is appreciated. |
Ritaja
commented
May 2, 2016
|
@sinhrks So the fix for inconsistent signatures should wait for the next release (0.18.2) ? Forgive me for paraphrasing. |
Ritaja commentedApr 26, 2016
Code Sample
>>> import pandas as pd>>> df = pd.DataFrame(np.zeros((4,5),dtype=int))>>> sparse = df.to_sparse()>>> sparse.loc[[1]] != 0Expected Output
0 1 2 3 41 False False False False FalseObserved Output
TypeError: _combine_const() got an unexpected keyword argument 'raise_on_error'output of
pd.show_versions()INSTALLED VERSIONS
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 4.2.0-35-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: None
pip: 8.1.1
setuptools: 20.9.0
Cython: None
numpy: 1.10.4
scipy: 0.16.1
statsmodels: None
xarray: None
IPython: None
sphinx: 1.3.1
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.3.1
openpyxl: None
xlrd: None
xlwt: 1.0.0
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.999
httplib2: 0.8
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: None
Reason
pandas.core.frameimplements_combine_const(self, other, func, raise_on_error=True)while
pandas.sparse.frameimplements_combine_const(self, other, func)and the missing argument in the signature is the cause of the error when using sparse frames. This is raised due to the call
res = self._combine_const(other, func, raise_on_error=False)from_comp_method_FRAMEatpandas.core.ops