I am new to coding, am currently trying to implement the Udacity Data Science course. An attempt to recreate an example in a lecture.
Here is the code:
import pandas as pd import numpy as np d = { 'name': Series(['Braund', 'Cummings', 'Heikkinen', 'Allen'], index=['a', 'b', 'c', 'd']), 'age': Series([22, 38, 26, 35], index=['a', 'b', 'c', 'd']), 'fare': Series([7.25, 71.83, 8.05], index=['a', 'b', 'd']), 'survived?': Series([False, True, True, False], index['a', 'b', 'c', 'd']) } df = DataFrame(d) print df
Here is my mistake:
Traceback (most recent call last): File "dataframe.py", line 4, in <module> d = {'name': Series(['Braund', 'Cummings', 'Heikkinen', 'Allen'], NameError: name 'Series' is not defined Aschs-MacBook-Air:mystuff aschharwood$
I save the .py file and run in the terminal.
Your help and guidance is greatly appreciated!