Last active
May 28, 2020 21:19
-
-
Save kurasaiteja/6ad1b54f2223dc5d7420ca13979967cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Print created_at to see the original format of datetime in Twitter data | |
print(df_tweet['created_at'].head()) | |
# Convert the created_at column to np.datetime object | |
df_tweet['created_at'] = pd.to_datetime(df_tweet['created_at']) | |
# Print created_at to see new format | |
print(df_tweet['created_at'].head()) | |
# Set the index of df_tweet to created_at | |
df_tweet = df_tweet.set_index('created_at') | |
# Create a python column | |
df_tweet['python'] = check_word_in_tweet('python', df_tweet) | |
# Create an js column | |
df_tweet['js'] = check_word_in_tweet('javascript', df_tweet) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment