catch22 icon indicating copy to clipboard operation
catch22 copied to clipboard

Python 3. Dead kernel after catch22 usage

Open IvMig opened this issue 5 years ago • 5 comments

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)]) 

IvMig avatar Nov 19 '19 10:11 IvMig

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

chlubba avatar Nov 19 '19 10:11 chlubba

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)

IvMig avatar Nov 19 '19 10:11 IvMig

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.

chlubba avatar Nov 19 '19 10:11 chlubba

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]))

IvMig avatar Nov 19 '19 10:11 IvMig

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

straiffix avatar Jun 13 '21 22:06 straiffix