英文:
SyntaxError: invalid decimal literal (gdrive)
问题
user_interactions_df = pd.read_csv(https://drive.google.com/uc?export=download&id=1WgjXneyZHGQrxrh1maRyPdbXE3J9wp--)
SyntaxError: invalid decimal literal
Any advice would be helpful.
Thank you in advance.
I just want to run my code!!
First time on stack overflow:)
thanks
英文:
user_interactions_df = pd.read_csv(https://drive.google.com/uc?export=download&id=1WgjXneyZHGQrxrh1maRyPdbXE3J9wp--)
^
SyntaxError: invalid decimal literal
Any advice would be helpful.
Thank you in advance.
I just want to run my code!!
Firstt time on stack overflow:)
thanks
答案1
得分: 2
read_csv()
函数接受一个包含文件路径的字符串参数。
你正在尝试的方法不会起作用,因为pd.read_csv()
无法从网址请求文件。请下载.csv文件并将文件路径作为参数传递给函数。
在这里查看pandas的read_csv()
文档:https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html
英文:
The read_csv()
function takes a string argument containing the file path.
What you are trying to do will not work, as pd.read_csv()
can not request the file from a web address. Download the .csv file and pass the file path to the function as an argument.
Check out the pandas read_csv()
documentation here: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论