Here a sample code to get an object list:
import numpy as np
class simpleobj():
def __init__(self,name):
self.attr1 = name
self.attr2 = f"{name}_{np.random.randint(1,100)}"
self.x= np.random.randint(1,100,size=(100,1))
self.y1= np.random.randint(1,100,size=(100,1))
self.y2= np.random.randint(1,100,size=(100,1))
objectlist=[simpleobj(i) for i in list('SAMPLETHINGTOWIRTENOIDEA') ]
I want to convert these list of object into a mi-dataframe. I've always end up with nested arrays in the dataframe... how to reach a multiindexed dataframe like this:
|----indexes----|
attr1 | attr2 | x | y1 | y2
'S' | 'S50' | 1 | 4 | 3
'S' | 'S50' | 2 | 5 |10