Skip to content

Instantly share code, notes, and snippets.

@ericfourrier
Created November 25, 2015 23:00
Show Gist options
  • Save ericfourrier/7ff43be64582a9cc9881 to your computer and use it in GitHub Desktop.
Save ericfourrier/7ff43be64582a9cc9881 to your computer and use it in GitHub Desktop.
import pandas as pd
from sqlalchemy import create_engine
url = "http://mlr.cs.umass.edu/ml/machine-learning-databases/iris/iris.data"
headers = ['Sepal Length', 'Sepal Width', 'Petal Length', 'Petal Width', 'Class']
iris = pd.read_csv(url, header=None, names=headers)
# absolute_path = 'sqlite:////{}'.format(path)
engine = create_engine('sqlite//:')
iris.to_sql('iris',engine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment