Strange compatibility issue with pandas
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.8k
- Forks
- 827
- PR merge metrics
- No merged PRs in 30d
Description
Hello, I am finding a strange issue where pandas breaks after I import some features from econml. For instance, if I want to inspect the label column:
df['label' works fine with no econml imports. But it throws an exception after importing:
from econml.dml import LinearDML, CausalForestDML
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/site-packages/sympy/interactive/printing.py", line 27, in _displayhook
print(stringify_func(arg, **settings))
File "/usr/local/lib/python3.8/site-packages/sympy/printing/printer.py", line 372, in __call__
return self.__wrapped__(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sympy/printing/pretty/pretty.py", line 2871, in pretty
return pp.doprint(expr)
File "/usr/local/lib/python3.8/site-packages/sympy/printing/pretty/pretty.py", line 66, in doprint
return self._print(expr).render(**self._settings)
File "/usr/local/lib/python3.8/site-packages/sympy/printing/printer.py", line 331, in _print
return printmethod(expr, **kwargs)
File "/usr/local/lib/python3.8/site-packages/sympy/printing/pretty/pretty.py", line 999, in _print_Series
args = list(expr.args)
File "/usr/local/lib/python3.8/site-packages/pandas/core/generic.py", line 5487, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'args'
What am I missing here?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with Python 3.8 by importing pandas, then LinearDML and CausalForestDML from econml.dml, and inspecting the label column. Start with the supplied traceback, particularly the interaction with SymPy's display hook and pandas Series. Done means the reported column inspection no longer raises this exception after the econml imports, with the behavior covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- data, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100