Python Forum
Selecting a sample based on index
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selecting a sample based on index
#1
Hi everyone,

I am trying to select a time period based on a date index. head of data below:

Output:
NZ Year-Qtr Mar-90 0.2 Jun-90 -0.5 Sep-90 -0.3 Dec-90 0.0 Mar-91 0.2
I am trying the following code to try select up until 'Mar-18'.

model_data = gdp_data.loc[:'Mar-18']
It is not working though, does anyone know how to select a date range when the date is the index?

I appreciate any help
Thanks
Reply
#2
try this
os.path.getctime('data.txt')
it return a float so you can make an > or <.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to rename dataframe columns based on the content in an index? ar_mahdavi 2 2,465 Jun-07-2021, 06:09 AM
Last Post: ricslato
  How to ger matching rows data based on index columns SriRajesh 1 2,206 Mar-08-2019, 11:05 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