Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

NameError: name ‘pd’ is not defined

# import pandas library
import pandas as pd
import numpy as np

# create pandas DataFrame
df =  pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]),
                   columns=['a', 'b', 'c'])

# print dataframe
print(df)
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #defined
ADD COMMENT
Topic
Name
6+1 =