Skip to content

BUG: interpolate gives a TypeError on empty dataframes #35598

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

Closed
3 tasks done
sanderland opened this issue Aug 7, 2020 · 1 comment · Fixed by #35543
Closed
3 tasks done

BUG: interpolate gives a TypeError on empty dataframes #35598

sanderland opened this issue Aug 7, 2020 · 1 comment · Fixed by #35543
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Regression Functionality that used to work in a prior pandas version
Milestone

Comments

@sanderland
Copy link
Contributor

sanderland commented Aug 7, 2020

Already fixed in #35543, making an issue for linking/discussion.

  • I have checked that this issue has not already been reported.

  • 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.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

from pandas import DataFrame
DataFrame().interpolate()
"Cannot interpolate with all object-dtype columns "

TypeError: Cannot interpolate with all object-dtype columns in the DataFrame. Try setting at least one column to a numeric dtype.

Problem description

This is a regression, 1.0.5 handles it fine.

The problem appeared due to checking np.all(obj.dtypes == np.dtype(object)) since the all of an empty set is True

Expected Output

Output of pd.show_versions()

pandas : 1.1.0

@sanderland sanderland added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 7, 2020
@simonjayhawkins simonjayhawkins added Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 7, 2020
@simonjayhawkins simonjayhawkins added this to the 1.1.1 milestone Aug 7, 2020
@simonjayhawkins simonjayhawkins added the Regression Functionality that used to work in a prior pandas version label Aug 7, 2020
@simonjayhawkins
Copy link
Member

change in behaviour caused by #33084 cc @jbrockmendel

e894809 is the first bad commit
commit e894809
Author: jbrockmendel [email protected]
Date: Sun Mar 29 08:16:17 2020 -0700

CLN: de-kludge NDFrame.interpolate (#33084)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Bug Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate Regression Functionality that used to work in a prior pandas version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants