Skip to content

Instantly share code, notes, and snippets.

@youngsoul
Last active May 6, 2021 19:49
Show Gist options
  • Select an option

  • Save youngsoul/edc1c17333148177c9771502ca7cb933 to your computer and use it in GitHub Desktop.

Select an option

Save youngsoul/edc1c17333148177c9771502ca7cb933 to your computer and use it in GitHub Desktop.
http://bit.ly/2nFLe2JDataSchool Pandas Video #2reading from url gave some SSL errors, and using requests was able to fix this.This is an example usage on how to get the movieusers
import pandas as pd
from io import StringIO
import requests
requests.packages.urllib3.disable_warnings()
url = 'http://bit.ly/movieusers'
data = requests.get(url=url, verify=False).text
data_reader = StringIO(data)
header_cols = ['user_id', 'age', 'sex', 'occupation', 'zip_code']
table = pd.read_table(data_reader, sep='|', headers=None, names=header_cols)
table.head(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment