I have a simple list
Code to retrieve i, v list:
for i, v in enumerate(list_name_1):
print(i, v)
Output
5 -100
4 30
0 -90
1 -80
3 100
2 1000
and so on
I wish to store all these in a dataframe.
The problem is I am doing lot of calculations on list_name_1 within the for loop, hence I need to catch i and v values in the for loop only. So I cant do a simple df=pd.DataFrame(list_name_1) for e.g.
I will need to do something like below:
df = []
for i, v in enumerate(list_name_1):
print(i, v)
some code to add i,v iteratively in columns i and v of df
list_name_1are unique, so the DataFrame should have very many columns, and very few rows?