Search code examples
pythonpandasdataframeyfinance

Pandas: Convert Yfinance dictionary to dataframe but the row is empty


I have a Yfinance dictionary like this:

{'zip': '94404', 'sector': 'Healthcare', 'fullTimeEmployees': 11800, 'circulatingSupply': None, 'startDate': None, 'regularMarketDayLow': 67.99, 'priceHint': 2, 'currency': 'USD'}

I want to convert it into DataFrame but the output has no information on Row:

Jupyter Notebook view:

enter image description here


Solution

  • Data = {'zip': '94404', 'sector': 'Healthcare', 'fullTimeEmployees': 11800, 'circulatingSupply': None, 'startDate': None, 'regularMarketDayLow': 67.99, 'priceHint': 2, 'currency': 'USD'}
    

    Third bracket around the dictionary variable:

    df = pd.DataFrame([Data])
    df
    

    Result:

         zip    sector   fullTimeEmployees  circulatingSupply   startDate   regularMarketDayLow priceHint   currency
    0   94404   Healthcare  11800               None              None          67.99              2         USD