Skip to content
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

IndexError: cannot do a non-empty take from an empty axes. #988

Open
hn2 opened this issue Nov 30, 2022 · 5 comments
Open

IndexError: cannot do a non-empty take from an empty axes. #988

hn2 opened this issue Nov 30, 2022 · 5 comments
Assignees
Labels

Comments

@hn2
Copy link

hn2 commented Nov 30, 2022

This error occurs when using EfficientFCParameters or ComprehensiveFCParameters (not MinimalFCParameters).
Error does not occur when pandas version is 1.3.5. However this is an old version and is not compatible with other python packages.
Can you please resolve the issue making it work with later panda versions such as 1.4.3?

@hn2 hn2 added the bug label Nov 30, 2022
@nils-braun
Copy link
Collaborator

nils-braun commented Feb 21, 2023

Hi @hn2 !
Thanks for filing the issue and sorry for the late response.
Unfortunately, I can not reproduce the issue. Do you maybe have a minimal example?

I am using pandas in version 1.5.3 on python 3.9 with the following code:

import tsfresh
from tsfresh.feature_extraction import ComprehensiveFCParameters
from tsfresh.examples.robot_execution_failures import load_robot_execution_failures

if __name__ == "__main__":
    df, y = load_robot_execution_failures()
    print(tsfresh.extract_features(df, column_id="id", column_sort="time", 
                                   default_fc_parameters=ComprehensiveFCParameters()))

@nils-braun nils-braun self-assigned this Feb 22, 2023
@morestart
Copy link

I have this problem when using Pandas version 2.0. It works when I use version 1.3.5.

@dor132
Copy link

dor132 commented Jun 9, 2023

I am facing this problem with pandas 1.5.2, and tsfresh 0.19.0.
I am not using any default_fc_parameters.
I've noticed that when using a smaller number of rows (in my case, ~200) it works fine. When going up to 220 rows it crashes.

Maybe it has something to do with number of unique IDs? With 200 rows, I have 16-17 unique IDs (works), with 220 rows it goes up to 19-20 (doesn't work).

I still haven't found anything else that seems suspicious.

@nils-braun
Copy link
Collaborator

nils-braun commented Jun 14, 2023

@dor132 , @morestart, @hn2 - has one of you a reproducible example with the data for me? Anything I can use for debugging? Thank you!

Or does anyone maybe have the full stacktrace?

@dor132
Copy link

dor132 commented Jun 15, 2023

@nils-braun Yes.
In my case I eventually concluded the problem was an ID that had a single row in the DataFrame.
Eliminating such IDs resolved the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants