chriotte / wearable_stress_classification

Stress classifier with AutoML
http://dataespresso.com/en/2019/01/30/Stress-detection-with-wearable-devices-and-Machine-Learning/
52 stars 35 forks source link

TypeError: 'NoneType' object is not subscriptable #1

Open italha91 opened 5 years ago

italha91 commented 5 years ago

When I ran This section: selected_x_columns = ['HR','interval in seconds','AVNN', 'RMSSD', 'pNN50', 'TP', 'ULF', 'VLF', 'LF', 'HF','LF_HF'] X = dataframe_hrv[selected_x_columns] y = dataframe_hrv['stress'] I get this error: X = dataframe_hrv[selected_x_columns] TypeError: 'NoneType' object is not subscriptable

abidJeelani commented 5 years ago

I have the same issue.. did any one k now how to remove NoneType object is not subscripted error??

chriotte commented 5 years ago

Sorry for my late reply, I haven't see this before now! The Notebook is running fine for me and I'm not able to repoduce the error. Generally the Nonetype error occurs when there is an empty list, are both of you able to load the data in the previous steps?

Screenshot 2019-05-10 at 18 58 59
chriotte commented 5 years ago

I have updated the Notebook with some example output, please do a pull

pdeman commented 5 years ago

for any reason df=df.fillna(df.mean(),inplace=True) doesn't work on my computer (ubuntu 18.04, python 3.6.7 and pandas version pandas (0.25.0) I had to do this: df['HR'].fillna((df['HR'].mean()), inplace=True) df['HR'] = signal.medfilt(df['HR'],13) df['AVNN'].fillna((df['AVNN'].mean()), inplace=True) df['pNN50'].fillna((df['pNN50'].mean()), inplace=True) df['RMSSD'].fillna((df['RMSSD'].mean()), inplace=True) df['SDNN'].fillna((df['SDNN'].mean()), inplace=True) df['TP'].fillna((df['TP'].mean()), inplace=True) df['ULF'].fillna((df['ULF'].mean()), inplace=True) df['VLF'].fillna((df['VLF'].mean()), inplace=True) df['LF'].fillna((df['LF'].mean()), inplace=True) df['HF'].fillna((df['HF'].mean()), inplace=True) df['LF_HF'].fillna((df['LF_HF'].mean()), inplace=True)

FarzadAvari commented 4 years ago

Hi, I tried to resolve the error by using pdeman's solution but no luck. I am still acing this issue, can anyone help me ? I am doing this on google colab

TrinaDutta95 commented 3 years ago

I faced this same issue of 'NoneType' object is not subscriptable. Any idea on how to fix it?

atulwadkar27 commented 3 years ago

Just Replace following line df=df.fillna(df.mean(),inplace=True)

with df.fillna(df.mean(),inplace=True)

it will resolve this issue...