我正在尝试使用 Pandas 读取文件,但出现权限错误。我试过使用 chmod 和 chown 来更改权限设置,但这没有任何区别。这是代码,注释行是我尝试过的解决方案:-
import pandas as pd
import os
#from os import stat
#from os import chmod
filepath = r"C:\Users\Vinayak Vaidyanathan\OneDrive\Documents\Visual Studio\Renewtech\raw\[IN-023C]\2018\2018-12\Inverter_1"
#os.chmod(filepath,777)
df = pd.read_csv(filepath)
df
# print("Owner id of the file:", os.stat(filepath).st_uid)
# print("Group id of the file:", os.stat(filepath).st_gid)
# uid = 3000
# gid = -1
# os.chown(filepath, uid, gid)
# print("\nOwner id of the file changed") ```