I have been trying for several hours to access a CSV file on my Google drive.
I was able to access the drive. I actually created the file myself with another script. Now what I need is to import that file in Pandas with read_csv.
pd.read_csv('https://drive.google.com/uc?id=1k5Q9wuq-mIeCl1zpPF0DJ31uzlJ8QfSO',encoding="ISO-8859-1")
When I try to do it, I get the following error:
ParserError: Error tokenizing data. C error: Expected 1 fields in line 6, saw 2
I have realized that it has something to do with the share permissions. The error appears if the file is available in a restricted way. But if I manually change that to 'anyone with the link', then it works and pandas can create the df.
I also tried
read_csv('https://drive.google.com/uc?id=1k5Q9wuq-mIeCl1zpPF0DJ31uzlJ8QfSO',encoding="ISO-8859-1",error_bad_lines=False)
However, it gives a summary of fields as a 1 column table, but it help me to confirm that the problem isn't on the google drive connection.
What can I do to fix this or how can I change those file permissions temporarily to read the DF and then restore the permissions to 'restricted'.
Thanks.