Reputation: 21
Does pandas 0.13.0 support Teradata ODBC connection? I am trying to create a table in teradata from a pandas dataframe object using a pyodbc connection.
The code I am using is below:
import pyodbc
import pandas
connection=pyodbc.connect('DRIVER={Teradata};dbcname=dbcname;uid=userid;pwd=password;databasename=db_name;quietmode=yes',autocommit=True)
data=pandas.read_csv(data_file)
data.to_sql('table_name',con=connection,flavor=None)
I am getting a NotImplementedError.
Thanks in advance!!
Upvotes: 2
Views: 997
Reputation: 139242
This is not supported in pandas 0.13.0 (flavor cannot be None, only 'sqlite' and 'mysql' are supported).
In more recent versions of pandas (starting with pandas 0.14), the database support has been expanded through the use of SQLAlchemy. So now, all database flavors that are supported by sqlalchemy can be used in to_sql
(see docs).
For the case of a teradata server, I am not sure (no experience with this). The only requirement to use it with to_sql
is that you can connect to it with an sqlalchemy engine. However, I don't directly find something about that.
Upvotes: 2