Python Forum
Iterate through dataframe to extract delta of a particular time period
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Iterate through dataframe to extract delta of a particular time period
#2
Since rows corresponds days you can just shift the data frame on 6 positions and compute difference between shifted and original ones:

(df.shift(6).iloc[:, 1] - df.iloc[:,1])[df.index % 6 == 0].dropna()
Reply


Messages In This Thread
RE: Iterate through dataframe to extract delta of a particular time period - by scidam - Oct-22-2020, 12:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Identify anomalies in a payment detail dataset for a period klllmmm 1 1,913 Aug-05-2021, 09:41 AM
Last Post: Larz60+
  Extract the categorial variables of a DataFrame Tut 1 2,149 Sep-20-2020, 09:21 AM
Last Post: scidam
  Simple String to Time within a pandas dataframe Ecniv 1 2,528 Jun-14-2019, 03:25 AM
Last Post: scidam
  splitting time (h,m,s) from dataframe column dedaelfl 2 5,349 Oct-09-2018, 12:28 PM
Last Post: volcano63
  How to extract only time from the date_time? Jack_Sparrow 1 4,029 May-11-2018, 01:42 PM
Last Post: Larz60+
  extract specific content in a pandas dataframe with a regex? steve1040 0 13,557 Oct-05-2017, 03:17 AM
Last Post: steve1040
  is a pandas dataframe timeseries time index in a specified range (but ignoring date)? m_lotinga 4 19,231 Dec-12-2016, 10:51 PM
Last Post: m_lotinga

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020