Skip to content

Python Data Science Toolbox (Part 1)

Run the hidden code cell below to import the data used in this course.


1 hidden cell

Take Notes

Add notes about the concepts you've learned and code cells with code you want to keep.

Add your notes here

# Add your code snippets here

#Funciones

# def x() <---- function header
# y = a+b  <----- function body
# print(y)

#def x(z)
# y = z + a
# return(y)

# c = x(z)
# print(c)

# Funciones scon varios parametros

# def x(value1, value2): <---- Function Header

# y = value1 ** value2
# y2 = value2 ** value1

# new_tuple = (new_value1, (new_value2)

# return new_tuple


Explore Datasets

Use the DataFrame imported in the first cell to explore the data and practice your skills!

  • 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!