having a dataframe as below:
data={'column1':[1,1,1,1,1,1,1,1,2,2,2,2],'person':['A','A','A','A','B','B','B','B','C','C','C','C'],'location1':['GOA','BANGLORE','GOA','BANGLORE','BANGLORE','DELHI','BANGLORE','DELHII','KOCHI','DELHI','DELHI','KOCHI'],'location2':['BANGLORE','GOA','GOA','BANGLORE','DELHI','DELHI','BANGLORE','BANGLORE','DELHI','KOCHI','DELHI','KOCHI'],'time':[20,40,0,0,34,0,0,23,21,56,0,0]}
df = pd.DataFrame(data)
need to create a list of list
for i in set(df.column1):
for j in set(df.person):
col=['location1','location2','time']
print(df[col].values.tolist())
But couldn't do the rest. Can anyone help me to create list of list?
A
in that? Shouldn't those be strings?