How to do it...

  1. Read in the altered movie dataset, and output the first five rows:
>>> movie = pd.read_csv('data/movie_altered.csv')>>> movie.head()
  1. This dataset contains information on the movie itself, the director, and actors. These three entities can be considered observational units. Before we start, let's use the insert method to create a column to uniquely identify each movie:
>>> movie.insert(0, 'id', np.arange(len(movie)))>>> movie.head()
  1. Let's attempt to tidy this dataset with the wide_to_long function to put all the actors in ...

Get Numerical Computing with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.