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

TypeError: 'NoneType' object is not subscriptable #1

Open
italha91 opened this issue Apr 23, 2019 · 7 comments
Open

TypeError: 'NoneType' object is not subscriptable #1

italha91 opened this issue Apr 23, 2019 · 7 comments

Comments

@italha91
Copy link

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
Copy link

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

@chriotte
Copy link
Owner

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
Copy link
Owner

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

@pdeman
Copy link

pdeman commented Aug 7, 2019

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
Copy link

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
Copy link

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

@atulwadkar27
Copy link

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

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

it will resolve this issue...

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

7 participants