How to write a Pandas DataFrame for Microsoft SQL Server

Background

I have a CSV file that is read in a Pandas DataFrame. I made some conversions to a DataFrame (clearing and merging columns with other data sources). I am left with a DataFrame, which I want to write to a new table on Microsoft SQL Server, but Pandas version .13 ( last ) has only "sqlite", "mysql" and "oracle".

Question

How can I switch from a DataFrame to a table in MS SQL Server? Data are not multiple index levels.

I looked at the Pandas' 'sql.write_frame' method, but "mssql" does not exist. I tried to create dev (version .14), but my Windows machine seems to be having problems with the MinGW C ++ compiler (separate issue).

import pandas #... #Read CSV file into DataFrame CallsKO = pandas.io.parsers.read_csv(filepath_or_buffer=filename, \ sep=';', quotechar='"') # Select Dataframe and write to SQL, but no mssql support pandas.io.sql.write_frame(frame=CallsKO, con=cnxn, name='Test', \ flavor='sqlite') 
+6
source share

All Articles