I'm trying to import a CSV into pandas and view the data frame. I'm following a tutorial that says I can e.g. retrieve the headers via data.head()
.
This doesn't return anything when I run the program and I have to put print
around everything to make it work.
What am I doing wrong?
import os
path = "testdata"
os.chdir(path)
os.getcwd()
data = pd.read_csv("testdata.csv")
print(data.head())
list(data.columns.values)