Python में सोशल मीडिया डेटा का विश्लेषण
Alex Hanna
Computational Social Scientist
#rstats बनाम #pythonstr.containsSeries का string मेथडSeries लौटाता हैcase = False - केस-इंसेंसिटिव सर्चimport pandas as pdtweets = pd.DataFrame(flatten_tweets(companies_json))apple = tweets['text'].str.contains('apple', case = False)print(np.sum(apple) / tweets.shape[0])
0.112
apple = tweets['text'].str.contains('apple', case = False) for column in ['extended_tweet-full_text', 'retweeted_status-text', 'retweeted_status-extended_tweet-full_text']: apple = apple | tweets[column].str.contains('apple', case = False)print(np.sum(apple) / tweets.shape[0])
0.12866666666666668
Python में सोशल मीडिया डेटा का विश्लेषण