Python Forum
Error binding parameter 0 - probably unsupported type.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error binding parameter 0 - probably unsupported type.
#1
Hoping I can get some help on this error:

c.execute("INSERT INTO USMoneySupply (MonetaryBase, M1, M2) VALUES (?, ?, ?)", sqlite3.InterfaceError: Error binding parameter 0 - probably unsupported type.

api_key = open('quandlapikey.txt', 'r').read()

def data_extract(code):
    data = quandl.get(code, authtoken=api_key, collapse='monthly')
    data['Y/Y, (%)'] = data['Value'].pct_change(12)*100
    return data

m2 = data_extract('FRED/M2')
m1 = data_extract('FRED/M1')
mb = data_extract('FRED/BOGMBASEW')

conn = sqlite3.connect('Database.db')
c = conn.cursor()

def create_table():
    c.execute("CREATE TABLE IF NOT EXISTS USMoneySupply(MonetaryBase REAL, MonetaryBasePer REAL, M1 REAL, M1Per REAL, M2 REAL, M2Per REAL)")

def data_entry():
    mb_data = mb['Value']
    mb_per = mb['Y/Y, (%)']
    m1_data = m1['Value']
    m1_per = m1['Y/Y, (%)']
    m2_data = m2['Value']
    m2_per = m2['Y/Y, (%)']
    c.execute("INSERT INTO USMoneySupply (MonetaryBase, MonetaryBasePER, M1, M1Per, M2, M2Per) VALUES (?, ?, ?, ?, ?, ?)",
              (mb_data, mb_per, m1_data, m1_per, m2_data, m2_per))
    conn.commit()

create_table()
data_entry()
c.close()
conn.close()
Thank you.
Reply


Messages In This Thread
Error binding parameter 0 - probably unsupported type. - by illmattic - Jul-17-2020, 08:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  GroupBy - Sum = Error [datetime64 type does not support sum operations] BSDevo 4 2,798 Oct-27-2023, 07:22 PM
Last Post: BSDevo
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 2,605 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  Type error in Cross_val_score Vicral 0 1,825 Jul-20-2021, 12:18 PM
Last Post: Vicral
  type error array BrianPA 2 2,395 Jan-17-2021, 01:48 PM
Last Post: BrianPA
  Error Message: TypeError: unhashable type: 'set' twinpiques 4 18,924 May-22-2019, 02:31 PM
Last Post: twinpiques
  Error:unsupported operand type(s) for ** or pow(): 'list' and 'int' mcgrim 3 18,312 Mar-22-2019, 01:29 PM
Last Post: buran
  Type Error Confusion Oliver 4 14,471 Dec-06-2017, 03:20 PM
Last Post: Oliver
  type error and access violation error pyopengl hsunteik 0 3,324 Nov-04-2017, 04:51 AM
Last Post: hsunteik
  AUCPR of individual features using Random Forest (Error: unhashable Type) melissa 1 3,304 Jul-10-2017, 12:48 PM
Last Post: sparkz_alot
  Why am I getting a type error? WagmoreBarkless 7 7,525 Jan-19-2017, 10:29 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020