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.
#8
I found a different way to achieve the desired result:

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

def data_extract(code, column_name):
    data = quandl.get(code, authtoken=api_key, start_date='2000-01-01', collapse='monthly',)
    data['Y/Y, (%)'] = data['Value'].pct_change(12)*100
    data.rename(columns={'Value': column_name}, inplace=True)
    return data

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

df_merged = [mb,m1,m2]
df = reduce(lambda  left,right: pd.merge(left,right,on='Date', how='outer'), df_merged).fillna('-')

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

def data_entry():
    df.to_sql('US Money Supply', conn, if_exists='replace')
    conn.commit()
    c.close()
    conn.close()

data_entry()
Here I get no errors and the output I wanted.
Reply


Messages In This Thread
RE: Error binding parameter 0 - probably unsupported type. - by illmattic - Jul-18-2020, 09:32 PM

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