Python Forum
Working with date indexes (pandas)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working with date indexes (pandas)
#1
Hi all,
I have a dataset with time stamps and I am happy that I can use timestamps as indexes.
I have an issue though that I do not know how, I can make variables of time periods that the indexing will understand.

For example in the data below
data_test.index[0]

[22]:
Timestamp('2019-02-08 14:10:07.409000')

how I can pick with variables (with fixes string is easy) rows that are inside that time period?

Also how I can make a new time variable that now includes a shift?

For example something like

data_test.index[0].timedelta(milliseconds=500)


does not work but the idea is to be able to to have a rolling window based on time stamps that returns me subsets of the initial data frame (pandas).

Can you please suggest me which functions to use?

Thanks a lot
Alex
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas read csv file in 'date/time' chunks MorganSamage 4 1,692 Feb-13-2023, 11:24 AM
Last Post: MorganSamage
  Pandas replace function not working on datafram with floats bcrypto 1 2,869 Apr-12-2021, 08:59 PM
Last Post: bcrypto
  Does a pandas have a date without a time? AlekseyPython 6 4,920 Feb-10-2021, 09:24 AM
Last Post: Naheed
  Python Custom Module not working in Jupyter Notebook with Pandas fid 0 2,028 Jul-04-2020, 11:05 AM
Last Post: fid
  replace nan values by mean group by date.year, date.month wissam1974 5 8,439 Feb-19-2020, 06:25 PM
Last Post: AnkitGupta
  Obtaining Correct Date In Pandas DataFrame eddywinch82 14 5,969 Feb-17-2020, 11:45 AM
Last Post: eddywinch82
  Merging two DataFrames based on indexes from two other DataFrames lucinda_rigeitti 0 1,745 Jan-16-2020, 08:36 PM
Last Post: lucinda_rigeitti
  Trying to Pass date to pandas search from input prompt curranjohn46 1 2,102 Oct-10-2019, 10:01 AM
Last Post: curranjohn46
  Need help passing date to pandas query curranjohn46 1 5,458 Oct-10-2019, 09:59 AM
Last Post: curranjohn46
  Pandas converting date to epoch randor 2 3,905 Jul-16-2019, 02:41 AM
Last Post: scidam

Forum Jump:

User Panel Messages

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