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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.