January 2019
Intermediate to advanced
342 pages
9h 17m
English
To extract all the inbound tweets that are posted by customers, we need to fetch all the tweets that have the in_response_to_tweet_id field as null. The outbound file that contains the customer service representative responses can be extracted by filtering by tweets where the in_response_to_tweet_id field is not null. Once we have the inbound and the outbound files, we need to merge them on the tweet_id of the inbound file and the in_response_to_tweet_id of the outbound file. This will give us our file with the tweets in by the customers and the tweets out by the customer service representatives in response. The data creation function can be coded as follows:
def process_data(self,path): data = pd.read_csv(path) ...
Read now
Unlock full access