-1

Can someone please help me use the head() function correctly? I'm pretty sure I have to use the read_csv() function beforehand but I'm not sure how to do that as my dataset isn't .csv. I'm also not sure how to link digits to data or if I even need the data variable at all. I bolded what I know shouldn't be there.

#Load iris data from scikit-learn's datasets
from sklearn.datasets import load_iris
digits = load_iris()

#Print the first five rows of the data
import pandas as pd
data = pd.read_csv(**'foo.csv'**, header=None) 
data.head()
bonnie
  • 1
  • 2

1 Answers1

0

data.head(5) should work. more documentation here https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.head.html

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
py_newbie
  • 329
  • 2
  • 9