spacepaste

  1.  
  2. import pandas
  3. import sqlalchemy as sql
  4. import pymysql
  5. connect_string = 'mysql+pymysql://stuff'
  6. sql_engine = sql.create_engine(connect_string)
  7. my_csv = pandas.read_csv('test_dom.csv', usecols=['index', 'id', 'title', 'body', 'author_id'])
  8. my_csv.to_sql(con=connect_string, name='blog', if_exists='append')
  9.