Error message

  • Notice: Trying to access array offset on value of type int in element_children() (line 6609 of /var/data/sites/methodi.ca-7.63/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6609 of /var/data/sites/methodi.ca-7.63/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6609 of /var/data/sites/methodi.ca-7.63/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6609 of /var/data/sites/methodi.ca-7.63/includes/common.inc).
  • Notice: Trying to access array offset on value of type int in element_children() (line 6609 of /var/data/sites/methodi.ca-7.63/includes/common.inc).
  • Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/data/sites/methodi.ca-7.63/includes/common.inc).

TATR: Panda and CSV of Tweets

Introduction 

This recipe is part of the Text Analysis for Twitter Research (TATR) series. The recipe will show how to load and save a CSV (comma-separated values) file into a Panda data structure.

Ingredients 
Steps 
  • Open a new Jupyter Notebook and import the following libraries:
    • PANDAS
    • NUMPY
  • Create a Panda dataframe
  • Import your Twitter data into the following 4 columns:
    • Index
    • Date
    • Retweet_Count
    • Text
  • Write a function that reads the dataframe and converts it into a CSV
  • Write a function that reads the saved dataframe and loads the CSV back in
  • Display the results
Discussion 

The TATR library was presented as an academic poster in 2018’s Congress held in Regina, SK. For a PDF version of the full poster, please visit:

Next steps / further information 

This recipe describes components that are fundamental for some of the more advanced TATR notebooks.

Status