我正在研究这个https://www.kaggle.com/edqian/twitter-climate-change-sentiment-dataset。
\n我已经将情绪从数字转换为其字符描述(即 0 将是中性,1 将是赞成,-1 将是反)
\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\ntweets_df = pd.read_csv(\'twitter_sentiment_data.csv\')\n\ntweets_df.loc[tweets_df[\'sentiment\'] == 0, \'twt_sentiment\'] = \'Neutral\'\ntweets_df.loc[tweets_df[\'sentiment\'] == -1, \'twt_sentiment\'] = \'Anti\'\ntweets_df.loc[tweets_df[\'sentiment\'] == 1, \'twt_sentiment\'] = \'Pro\'\n\ntweets_df = tweets_df.drop([\'sentiment\'], axis=1) \n\n# display(tweets_df.head())\n message tweetid twt_sentiment\n0 @tiniebeany climate change is an interesting hustle as it was global warming but the planet stopped warming for 15 yes while the suv boom 792927353886371840 Anti\n1 RT @NatGeoChannel: Watch #BeforeTheFlood right here, as @LeoDiCaprio travels …Run Code Online (Sandbox Code Playgroud)