skip to Main Content

How to split Json string column in Pandas Dataframe with multiple lists to multiple columns?

I have a json string column in a dataframe that looks like this. {"columns":["ApplicationNum","eads59Us01S","HouseDeal_flag","Liability_Asset_Ratio","CBRAvailPcnt","CMSFairIsaacScore","OweTaxes_or_IRAWithdrawalHistry","eads14Fi02S","GuarantorCount","CBRRevMon","CBRInstalMon","CMSApprovedToRequested","SecIncSource","eads59Us01S_4","Liability_Asset_Ratio_40_90","CBRAvailPcnt_20_95","CMSFairIsaacScore_Fund","eads14Fi02S_2","InstalMonthlyPayments_400_3k","RevolvingMonthlyPayments_1k_cap","ApprovedToRequested_0_100","NoSecIncome","coef_eads59Us01S_4","coef_HouseDeal_flag","coef_Liability_Asset_Ratio_40_90","coef_CBRAvailPcnt_20_95","coef_CMSFairIsaacScore_Fund","coef_OweTaxes_or_IRAWithdrawalHistry","coef_eads14Fi02S_2","coef_GuarantorCount","coef_RevolvingMonthlyPayments_1k_cap","coef_InstalMonthlyPayments_400_3k","coef_ApprovedToRequested_0_100","coef_NoSecIncome","coef_Intercept"],"data":[[569325.0,2,0.0,1,92,825,0.0,4,1.0,74,854,0.51,2,2.0,0.9,92.0,825.0,4.0,854.0,1000.0,0.51,0.0,0.11716245,0.299528064,0.392119645,-0.010826643,-0.004957868,0.339407077,0.061509795,0.3685047,0.000167603,0.000225742,0.902205454,-0.371734864,2.788087559]]} I have a columns tag in there with a list of column values, and a data tag in there with the corresponding list of values for…

VIEW QUESTION

Python : nested json to dataframe

I'm trying with python to convert a nested json content into a dataframe : { "end_date":"2023-02-02-00:00", "price":{ "2023-01-30":{ "CHFEUR":{ "close":0.99612, "high":0.99939, "low":0.99408, "open":0.99925 }, "CHFUSD":{ "close":1.08098, "high":1.08884, "low":1.08041, "open":1.08579 }, "EURUSD":{ "close":1.08518, "high":1.0914, "low":1.08393, "open":1.08609 } }, "2023-01-31":{ "CHFEUR":{ "close":1.00489,…

VIEW QUESTION

got multiple values for argument 'schema' – Postgresql

self.engine=create_engine("postgresql://postgres:12345@localhost/postgres") self.con = self.engine.connect() self.conn.autocommit = True self.cursor = self.conn.cursor() df.to_sql(symbol, schema='xxx', con=self.con, if_exists='append', index=False) df.to_sql(symbol, con=self.con, if_exists='append', index=False) I am getting this error in both cases while adding the dataframe to the postgre sql database meta = MetaData(self.connectable, schema=schema)…

VIEW QUESTION
Back To Top
Search