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

Python 3. Dead kernel after catch22 usage #7

Open
IvMig opened this issue Nov 19, 2019 · 5 comments
Open

Python 3. Dead kernel after catch22 usage #7

IvMig opened this issue Nov 19, 2019 · 5 comments

Comments

@IvMig
Copy link

IvMig commented Nov 19, 2019

OS: Ubuntu 18.04
Python version: 3.6.3
Catch22 version: 0.0.1

Issue description:
I generate dataframe with small amount of data in columns (1,2,3,4 elements, etc.). I try to use catch22_all method in a case when amount of data is equal to 2 and I have dead kernel as output.

Code example:

groups = df.groupby(["column_id"]).groups
for id_group, idx in groups.items(): 
      group_data = df.loc[idx].drop(["column_id"], axis=1)
      # Dead kernel when group_data.shape[0] == 2
      buf = pd.DataFrame([f for f in group_data.apply(catch22.catch22_all)]) 
@chlubba
Copy link
Collaborator

chlubba commented Nov 19, 2019

Hello Migal,

sorry to hear you are experiencing trouble with catch22. What do you mean by "amount of data is equal to 2"? catch22_all is only suited for univariate time series that are stored in a vector. Did you try it without the apply function of pandas?

Carl

@IvMig
Copy link
Author

IvMig commented Nov 19, 2019

What do you mean by "amount of data is equal to 2"?

I mean case when group_data.shape[0] == 2

Did you try it without the apply function of pandas

Sure. This code have the same behavior:
buf = pd.DataFrame(catch22.catch22_all(group_data[column_name]), dtype=np.float64)

@chlubba
Copy link
Collaborator

chlubba commented Nov 19, 2019

Please try it without the direct use of pandas data frames by converting the column to a numpy array. I'll try to make catch22 pandas-ready but I guess for now you'll have to stick with Python lists or numpy arrays.

@IvMig
Copy link
Author

IvMig commented Nov 19, 2019

Please try it without the direct use of pandas data frames by converting the column to a numpy array. I'll try to make catch22 pandas-ready but I guess for now you'll have to stick with Python lists or numpy arrays.

I understand your concerns.

I try to set list as input into the catch22 functions and I have dead kernel as result. Here is the code:

functions = dir(catch22)[:-11] # get all functions from catch22
i=0
func = getattr(catch22, functions[i])
func(list(group_data[column_name]))

@straiffix
Copy link

Have the same problem, kernel dies if apply function on array with len 1 or 2.
Could be useful to add exception for it.

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

No branches or pull requests

3 participants