简体   繁体   中英

How do I read this CSV in Jupyter Notebook?

I have to work on this Student Performance data set from here: https://archive.ics.uci.edu/ml/machine-learning-databases/00320/ ,

I managed to import the student-mat.csv in notebook but I checked the excel and saw everything about each student is written only into the very first box of each row, and is 'separatted' by quotation marks so I cant make the computer read each column distinctively? you can see here

How do I make this readable and into an actual table in notebook?

They are delimited by ";", so you will have to use the delimiter parameter of read_csv .

student_mat=pd.read_csv("student-mat.csv", delimiter=";")
student_pos=pd.read_csv("student-por.csv", delimiter=";")
print (student_mat.head(2))
print (student_pos.head(2))

Output: 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM