- Read in the restaurant inspections dataset, and convert the Date column data type to datetime64:
>>> inspections = pd.read_csv('data/restaurant_inspections.csv', parse_dates=['Date'])>>> inspections.head()
- This dataset has two variables, Name and Date, that are each correctly contained in a single column. The Info column itself has five different variables: Borough, Cuisine, Description, Grade, and Score. Let's attempt to use the pivot method to keep the Name and Date columns vertical, create new columns out of all the values in the Info column, and use the Value column as their intersection:
>>> inspections.pivot(index=['Name', ...