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

Index Error #19

Open
gopinathankm opened this issue Aug 21, 2019 · 3 comments
Open

Index Error #19

gopinathankm opened this issue Aug 21, 2019 · 3 comments

Comments

@gopinathankm
Copy link

When execute following statement from .ipynb file
`neg_idx = df[(df.news_category=='technology') & (df.sentiment_score == -15)].index[0]

I get following
IndexError Traceback (most recent call last)
in
----> 5 neg_idx = df[(df.news_category=='technology') & (df.sentiment_score == -15)].index[1]
~/anaconda3/envs/myenv/lib/python3.7/site-packages/pandas/core/indexes/base.py in getitem(self, key)
2082
2083 if is_scalar(key):
-> 2084 return getitem(key)
2085
2086 if isinstance(key, slice):
IndexError: index 1 is out of bounds for axis 0 with size 0`

Any assistance will be appreciated.
Gopinathan K.M

@raghavbali
Copy link
Collaborator

Hi @gopinathankm
Could you mention the particular notebook and chapter you are referring to. Also please mention your pandas and numpy versions

@gopinathankm
Copy link
Author

No problem I managed the issue. Thanks

@raghavbali
Copy link
Collaborator

@gopinathankm sure. If there's a fix you could share, please do so for everyone else's benefit.

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

2 participants