How can I retrieve a csv file directly from a url with pandas without having my data connection on | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can I retrieve a csv file directly from a url with pandas without having my data connection on

I have a link to a csv file inside a pdf. I'm trying to read the csv file directly from the web via pandas #i used the code below import pandas as pd data1=pd.read_csv('https://sthsthsth... sth.csv') data1 #But I keep getting a URL Error. So after sourcing the net. I found out some lines of code that was very useful and it actually retrieves the csv file directly to my console import pandas as pd from io import StringIO import requests url="https://sthsth... sth.csv" s=requests.get(url).content c=pd.read_csv(StringIO(s.decode('utf-08'))) c #But I have a challenge, the lines of code above only works when my PC is connected to a network QUESTION: Is there anyway I can achieve the same result without not having my pc connected to d net? Thanks I'll be really indebted in anyway anyone can provide an assistance David Nierman Fariha💕[inactive] Lothar Akintunde Taofeek Aad Hoogenboom Alaqmar #ForTheLoveOfPython https://code.sololearn.com/cJ3o4K8scOvL/?ref=app

12th Feb 2021, 10:11 AM
Mujeeb Adeyanju Sunmola
Mujeeb Adeyanju Sunmola - avatar
2 Answers
+ 1
The file looks like it’s on an online server, so there would be no way to download it unless you were online.
16th Feb 2021, 11:54 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 2
Sharp! Wilbur Jaywright I later realized this after many consultations . thanks so much for your time
18th Feb 2021, 5:36 AM
Mujeeb Adeyanju Sunmola
Mujeeb Adeyanju Sunmola - avatar