Open fluggo opened 3 years ago
I am trying to assist with this issue, however when I try to run my testcases I am getting a ModuleNotFoundError.
ModuleNotFoundError: No module named 'pandas._libs.interval'
Does anyone have an idea as to why this is?
@EricFleishman26 If you are using a clone of pandas in your development environment, it might be because you have not compiled the c extensions of pandas. See https://pandas.pydata.org/docs/development/contributing.html#creating-a-development-environment
[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.
[ ] (optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
This seems very similar to the description of #16621, and may be the same bug; check there for some history, which points to an original fix in #2476. You can also look at this StackExchange question if you want to see how I nearly pulled my hair out.
The first call of
.agg()
above, on the empty DataFrame, produces a DataFrame result. The second call of.agg()
produces a Series instead.This has unfortunate implications when used with
groupby()
:...produces:
...instead of:
Expected Output
I'm assuming that the call with data produces a series because the
agg()
is single-valued, therefore the top code should probably produce two Series:Actual output
Output of
pd.show_versions()