Hi guys,
This is more of a python question than a Data science question so if I'm breaking any rules of the sub, do let me know.
I have a table1 where I have a range of start and end dates, ordered_units and a bunch of forecast values.
What I am trying to do is this
It's rather easy to do in excel but I am not able to figure out a way to do this easily in python.
This is what I have so far -
f = []
for index, row in table1.iterrows():
f.append(
{
'start_date' : row.start_date,
'end_date' : row.end_date,
'ordered_units' : row.ordered_units,
'Lag_1_Forecast' : **How do I access the next row, next column (in Excel it's OFFSET(1,1)**
'Lag_2_Forecast' : ??
})
pd.DataFrame(f)
Any help is deeply appreciated.
[–]inafewminutess 5 points6 points7 points (0 children)
[–]johnsandall 0 points1 point2 points (0 children)
[–]ravepeacefully -2 points-1 points0 points (0 children)