skip to Main Content

Merge dataframes having array – SEO

I have two data frames. DF1 isActive,trackedSearchId True,53436615 True,53434228 True,53434229 DF2 trackedSearchIds,Primary Keyword Group(s) "[53436613, 53436615, 53437436, 53436506]",SEO - Directory-Deployment "[53435887, 53437509, 53437441, 53436615, 53438685, 53437636]",SEO - Other-Glossary "[53437504, 53435090, 53435887, 53434228]",SEO - Other "[53437504, 53435090, 53434229]",SEO - Glossary I…

VIEW QUESTION

Converting Json to pd

I'm trying to convert the Json type data to dataframe. I extrated data from following webpage with following code. webpage I extract data import pandas as pd import requests import json url = r'https://www.hkex.com.hk/eng/csm/MonthlyStat/data_tab_monthly_202302e.js?_=1' response = requests.get(url) if response.status_code !=…

VIEW QUESTION

Python format json for saving to file

My data looks like this: Key1: [Key2:[{},{},...{}]] The code something like this: dict_={} dict_['Key2']=all_items dict_fin={} dict_fin['Ke1']=[dict_] df=pd.DataFrame(dict_fin) df.to_json(filepath, orient="records",lines=True) I would like to have saved json like this: { "Key1": [{"Key2" : [{},{},...,{}]}] } Instead, I get it like this:…

VIEW QUESTION
Back To Top
Search