How to display multi level dataset


If I have this dataset

orders = [{
    "cust":"my cust",
            "item":"first item"        
            "item":"second item"        

How do you display it like

num   cust       item         qty
160   my cust   first item    111
                second item   222


You could reshape your dataset into wide format, along the lines of:

import numpy as np
import pandas as pd
import streamlit as st

orders = {
    "num":[160, 161],
    "cust":["my cust", "new cust"],
    "item":[["first item","second item"], ["first item"]],
    "quantity":[[111, 222], [10]]

df = pd.DataFrame(orders)


Thank you.

The dataset format is provided by an API, so don’t have much control over that.

So I guess, for now, after the call to the API, I’d have to reformat the dataset as you suggested.