Skip to content
Python Data Science Toolbox (Part 1)
  • AI Chat
  • Code
  • Report
  • Python Data Science Toolbox (Part 1)

    👋 Welcome to your workspace! Here, you can write and run Python code and add text in Markdown. Below, we've imported the datasets from the course Python Data Science Toolbox (Part 1) as DataFrames as well as the packages used in the course. This is your sandbox environment: analyze the course datasets further, take notes, or experiment with code!

    # Importing course packages; you can add more too!
    import pandas as pd
    from functools import reduce
    # Importing course datasets as DataFrames
    tweets = pd.read_csv('datasets/tweets.csv')
    tweets.head() # Display the first five rows
    # Begin writing your own code here!

    Don't know where to start?

    Try completing these tasks:

    • Write a function that takes a timestamp (see column timestamp_ms) and returns the text of any tweet published at that timestamp. Additionally, make it so that users can pass column names as flexible arguments (*args) so that the function can print out any other columns users want to see.
    • In a filter() call, write a lambda function to return tweets created on a Tuesday. Tip: look at the first three characters of the created_at column.
    • Make sure to add error handling on the functions you've created!