Skip to content

Instantly share code, notes, and snippets.

@himlohiya
Created June 30, 2018 12:53
Show Gist options
  • Select an option

  • Save himlohiya/44738084d7adb3bafd6c4f41ec40ae1c to your computer and use it in GitHub Desktop.

Select an option

Save himlohiya/44738084d7adb3bafd6c4f41ec40ae1c to your computer and use it in GitHub Desktop.
pos_idx = df[(df.news_category=='technology') & (df.sentiment_score == 6)].index[0]
neg_idx = df[(df.news_category=='technology') & (df.sentiment_score == -15)].index[0]
print('Most Negative Tech News Article:', news_df.iloc[neg_idx][['news_article']][0])
print()
print('Most Positive Tech News Article:', news_df.iloc[pos_idx][['news_article']][0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment