I have a series of tuple (looks like below) which are generated as the output of a particular step in my python program. This value is stored in a variable called out_put
and print(out_put)
shows the below result exactly.
(‘20240510’, ‘female’, ’21’, ’15’)
(‘20240510’, ‘male’, ‘118’, ’96’)
I want to convert this into a Dataframe, so that I can load into a table (bigquery). The dataframe should like
index Date_YYYYMMDD Gender Sessions User
0 20240510 female 21 15
1 20240510 male 118 96
Any help is appreciated.
Thanks
I have tried
print('List')
lst = list(out_put)
print(lst)
print('Dataframe')
df = pd.DataFrame(lst)
print(df)
It is only fetching the last row from the result and transposing the row.