Import the NumPy library under the alias np
and import the pandas library under the alias pd
.
import numpy as np
import pandas as pd
Turn the variable this_list
into a pandas Series. Name the Series this_series
.
this_list = ['a', 'b', 'c']
#Solution goes here
this_series = pd.Series(this_list)
Given the variable labels
, overwirte the this_series
variable you just created with a new version of this_series
that has labels
as its index.
labels = ['first', 'second', 'third']
#Solution goes here
this_series = pd.Series(this_list, index=labels)
Given the dictionary new_dict
, turn it into a pandas Seris named new_series
.
new_dict = {"brand": "Ford","model": "Mustang","year": 1964}
#Solution goes here
new_series = pd.Series(new_dict)