Ex.
childrens_lit.csv.bz2
file from the data
folder.
In [3]:
import pandas as pd
import nltk
import matplotlib.pyplot as plt
#read in our data
df = ...
Since the number of children literaturs is a lot to analyze, we'll just randomly select 5 books to do a sentiment analysis using the dictionary method.
Note: In case you're not familiar with seed. Seed is just a function that initializes a fixed state for random number generatoring. Basically if everyone uses the same number as an input to seed()
, then everyone will get the same result when generating randomly.
In [ ]:
import numpy as np
np.random.seed(1)
df = df.sample(5)
df
[your hypothesis here]
In [6]:
# Your code here