![]() |
Unable to read decimal datatype using pandasql - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Unable to read decimal datatype using pandasql (/thread-22033.html) |
Unable to read decimal datatype using pandasql - geethchi - Oct-25-2019 I have a parquet file with 4 columns. It looks something like below. TYPE | ID | SRNO | AMT D | 123456 | 1 | 100.00 D | 123457 | 2 | 200.00 D | 123459 | 3 | 500.00 D | 123458 | 4 | 1000.00 The Schema for this file is dataframe.printSchema NOTE : When I read this file in pandas the schema changes for decimal and is represented as objectpandas_dataframe.dtypes I get the below error when I try to run a sql on the Dataframe.ps.sqldf("select * from pandas_dataframe") FYI .. I tried casting the Decimal field to String , Double and it works fine . Does it mean Pandasql cannot handle a file that has Decimal Datatypes ? Is there a better programatic alternatives to handles this than Typecasting explicitly . Thanks in Advance |