July 2017
Beginner to intermediate
312 pages
7h 27m
English
In previous sections, we have analyzed the most frequent keywords and phrases without taking into account the time frame. However, a brand can benefit from a temporal dimension and dynamic analysis of the content of posts and comments.
Our goal in this section is to analyze in time series the moments of highest engagement to posts in terms of likes and shares and then see what those posts were about.
Firstly, we convert a string with a date into a datetime object:
df_comments['date'] = df_comments['created_time'].apply(pd.to_datetime)
The next operation transforms the data frame into a time series and creates an index on a datetime object:
df_comments_ts = df_comments.set_index(['date'])
Finally, we subset ...
Read now
Unlock full access