Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

to_sql id colymn

import sqlite3
import pandas as pd

df = pd.DataFrame({'MyID': [1, 2, 3], 'Data': [3, 2, 6]})
with sqlite3.connect('foo.db') as con:
    df.to_sql('df', con=con, dtype={'MyID': 'INTEGER PRIMARY KEY AUTOINCREMENT'})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #id #colymn
ADD COMMENT
Topic
Name
5+4 =