Category : xlrd

In excel sheet i have a Date column that can be null so i am using xlrd to read data from the sheet and using df.to_sql( con=engine, name=table.__tablename__, index=False, if_exists=’append’ ) to append to postgres database when i try i get sqlalchemy.ex.DataError:(psycopg2.errors.InvalidDateTimeFormat) invalid input syntax for type date: "" Line1 Insert into (1,2,3,’name’,”) ^ I ..

Read more

I’m trying to read .xlsx file with Python. However I noticed that popular library xlrd doesn’t work with .xlsx files. Here is the example with error message I’m getting: import xlrd if __name__ == ‘__main__’: loc = ("./excel_file.xlsx") wb = xlrd.open_workbook(loc) I’m getting the following error message while trying to run the code above: Traceback ..

Read more