简体   繁体   中英

How to Read CSV from url in pandas? - error tokenizing data

How can I download this following file in python? I have no issue doing this in R. I believe this issue is the last row in the file which will change. How can I change the code to work?

import pandas as pd
 url = "https://ark-funds.com/wp-content/uploads/funds-etf-csv/ARK_INNOVATION_ETF_ARKK_HOLDINGS.csv"
test = pd.read_csv(url) 

You should better download the csv file first by using the requests module . Then you can read the file from the download directory by passing the file path instead of the URL ( pd.read_csv(download_path) ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM