Yeah, it's kind of INTERESTING but annoying that I couldn't figure it out. Hope someone could help me, i appreciate it!!
I have a list like this
people_lst = [[[0.04184746, 0.029883996, 0.0009178036, ],
[0.014391203, 0.016383031, 0.005761528, ],
[0.010505916, 0.0038218796, 0.0056757517, ]],
[[0.029479079, 0.023749327, 0.0013516274, ],
[0.017781705, 0.026531693, 0.003175055,],
[0.0323914, 0.02072367, 0.006535718, ]]]
column = ["apple", "banana", "candy"]
I want to convert this listt to a dataframe and then to excel with different sheet names.
So my expected result is
[0.04184746, 0.029883996, 0.0009178036 ] is the first sheet first column
[0.014391203, 0.016383031, 0.005761528, ] is the first sheet second column
[0.029479079, 0.023749327, 0.0013516274, ] is the second sheet first column
[0.017781705, 0.026531693, 0.003175055,] is the second sheet second column
.
.
.
I have tried something like this
df = pd.DataFrame()
for i in range(2):
dfs = pd.DataFrame(people_lst[i]).T
df = pd.concat([df, dfs])
df
But it shows single sheet with 0,1,2,0,1,2 index.
By the way, I hope the sheet_name could be written in a range, because I have 40 sheets...
Thx