Buka CSV dari URL Python
import pandas as pd
url = "http://samplecsvs.s3.amazonaws.com/SalesJan2009.csv"
df = pd.read_csv(url)
print(df.head())
Joyous Jackal
import pandas as pd
url = "http://samplecsvs.s3.amazonaws.com/SalesJan2009.csv"
df = pd.read_csv(url)
print(df.head())
import requests
from contextlib import closing
import csv
url = "http://samplecsvs.s3.amazonaws.com/SalesJan2009.csv"
with closing(requests.get(url, stream=True)) as r:
f = (line.decode('utf-8') for line in r.iter_lines())
reader = csv.reader(f, delimiter=',', quotechar='"')
for row in reader:
print(row)
import csv
import urllib2
url = 'http://winterolympicsmedals.com/medals.csv'
response = urllib2.urlopen(url)
cr = csv.reader(response)
for row in cr:
print row