I am looking for a way to transform nested dictionary to dataframe
import requests
import pandas as pd
from bs4 import BeautifulSoup
r = requests.get('https://olxdata.azurewebsites.net/olx?city=wszystkie&dataType=mieszkania')
soup = BeautifulSoup(r.content, 'html.parser')
print(soup)
As you could see the format is as below, a dictionary with list of dictionaries as a value:
{"olx":[{"date":"2020-04-30T00:00:00","toSell":27964,"toRent":41664}(...)], "otodom":[{"date":"2020-04-30T00:00:00","toSell":27964,"toRent":41664}(...)]
There are two elements in this dictionary - ideally I would like them to be an index like below:
| date | toSell | toRent | |
|---|---|---|---|
| olx | |||
| otodom |