Python 3.6.5 pandas 0.25.3
Read comma-separated csv files with pandas.read_csv ()
FileNotFoundError: [Errno 2] File b'test.csv' does not exist: b'test.csv' Translation: b’test.csv’ not found!
test.csv
Name Japanese Mathematics English Science Society
0 A thick 83 89 76 97 76
1 B through 66 93 75 88 76
2 C child 100 84 96 82 94
3 Dro 60 73 63 52 70
4 E beauty 92 62 84 80 78
5 F greens 96 92 94 92 90
import pandas as pd
df = pd.read_csv("test.csv")
print(df)
For the time being, can you read csv first and check it on the console? It was an error when I tried to confirm the first move.
I added the following code and specified the current directory, and it was read without any problem. I wonder why the script and csv were placed in the same hierarchy ...
import os
#Specify the current directory
path =“Directory where csv is saved”
os.chdir(path)
Recommended Posts