Data: Data visualed in excel
- I have dataset as seen above.
- Can i use python to create dataframes: first red, do some calculations, save results. Create the blue and do calculations, save some data and green and so on?
- HELP! How!?
CodePudding user response:
You can start from here to use pandas
and load up the data from the excel file in a dataframe df
, then do something like
for window in df.rolling(window=2):
# computation on the sliding window...
CodePudding user response:
You need to be more specific about the calculation you need to perform. But what you are looking for is a rolling window
df_result = df.rolling(window=size_of_window).apply(func_to_apply)