wearable_stress_classification
wearable_stress_classification copied to clipboard
TypeError: 'NoneType' object is not subscriptable
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
I have the same issue.. did any one k now how to remove NoneType object is not subscripted error??
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?

I have updated the Notebook with some example output, please do a pull
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)
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
I faced this same issue of 'NoneType' object is not subscriptable. Any idea on how to fix it?
Just Replace following line df=df.fillna(df.mean(),inplace=True)
with df.fillna(df.mean(),inplace=True)
it will resolve this issue...