with open('~/Documents/data.csv', 'r') as f:
print(f.read())
data=pd.read_csv('~/Documents/data.csv')
when I used the first "with open" method, I got an error. But there is no problem when I use the "read_csv".
So could anyone tell me why? Thank you!
~in a path. Some just take it as a tilde.with opengave?/home/<username>/Documents/data.csvor use a module likepathlibtoexpanduser().