Questions tagged [datetimeindex]

Immutable ndarray of datetime64 data, represented internally as int64

Immutable ndarray of datetime64 data, represented internally as int64, and which can be boxed to Timestamp objects that are subclasses of datetime and carry metadata such as frequency information.

325 questions
0
votes
1 answer

Creating Datetime index in python

I am trying to create datetime index in python. I have an existing dataframe with date column (CrimeDate), here is a snapshot of it: The date is not in datetime format though. I intent to have an output similar to the below format, but with my…
John
  • 279
  • 1
  • 3
  • 16
0
votes
0 answers

Python: how to add 1 hour to DateTimeIndex?

I have the following dataframe: BTC ETH date 2016-11-10 01:00:00 714.02 10.55 2016-11-10 02:00:00 715.64 10.51 How can I convert the index (which is in GMT) to CET? Or, how can I add 1 hour to the…
MathMan 99
  • 665
  • 1
  • 7
  • 19
0
votes
1 answer

Add a column with the hourly difference of the Datetime Index

I have a Dataframe with a datetimeindex and I need to create a column that contains the difference in time between the rows of the datetimeindex expressed in hours. This is what I have: Datetime Numbers 2020-11-27 08:30:00 1 2020-11-27…
Gus
  • 193
  • 9
0
votes
3 answers

Pandas : Datetimeindex and Intervalindex intersection

I have very long time series for which i need to set values within intervals of certain events to np.nan. measures is a datetimeindexed dataframe and events is a distinct datetimeindex distinct. Measures looks like: | index | measure …
kubatucka
  • 555
  • 5
  • 15
0
votes
0 answers

How to Convert cummulative frequency values to normal frequency

It is an Pandas Data frame with dateTime index. This the Cumulative data observation daily frequency, I need to convert this data points to normal frequency. I need to convert the cummulative values to normal values for each and every day. It is an…
0
votes
1 answer

Delete rows from a pandas dataframe that have duplicate DatetimeIndex values using several condition

I have many dataframes with duplicate DatetimeIndex values. The example below shows the dataframe for id = 'D17'. I need to remove all duplicates based on several conditions. df = pd.DataFrame( {"id": ['D17', 'D17', 'D17', 'D17', 'D17', 'D17',…
David
  • 1
  • 1
0
votes
2 answers

How to change one of the Timestamp in pandas date range?

I want to change all of March into April. date = pd.date_range("2008-01-01", "2021-03-31", freq = "QS-MAR") date I try to change them by using timedelta. It can run, but the data do not change. for time in date: print(type(time)) if…
0
votes
1 answer

How to check if pandas DateTimeIndex dates belong to a list?

I have a pandas datetime index idx with with minute frequency, I also have a list(or set) of dates list_of_dates. I would like to return a boolean array of the same size of idx with the condition that the dates of datetime index belong is in the…
motam79
  • 3,542
  • 5
  • 34
  • 60
0
votes
2 answers

How to quickly filter pandas DatetimeIndex by hour

For example, I have a pandas Series as rng=pd.date_range('2020-12-20',periods=1000000,freq='H') s=pd.Series(np.random.randn(len(rng)), index=rng) It is simple to select all rows belong year 2021 by %timeit -n1 s['2021'] which is super fast, and…
user15964
  • 2,507
  • 2
  • 31
  • 57
0
votes
1 answer

Create a list which values based on existing DateTimeIndex

I got a DateTimeIndex from an existing Dataframe time=df.index[19:] With a certain range of time, I want to create a certain value list=[] for i in range(0,len(time)): #if time[i] in the range of '2020-06-25 11:53:05' to '2020-06-25 12:23:05':…
mylearning
  • 65
  • 6
0
votes
1 answer

How to extract property of pandas index from string

I have a question, How can I extract index property from string variable in pandas? I want to extract particular properties from datetime index in a loop. code attached below: features_list = ['dayofweek', 'dayofyear', …
0
votes
1 answer

Convert DateTimeIndex column headings to Date

I've got a dataframe which uses DateTimeIndex for column headings. These are currently displaying in the format 2021-05-01 00:00:00. How can I get rid of the "00:00:00"? I've looked up a few similar questions here on SO and the general response is…
Ani23
  • 71
  • 2
  • 6
0
votes
3 answers

'DataFrame' object has no attribute 'DatetimeIndex'

I am trying to return a Pandas with Date that has been set as the DateTimeIndex. I have tried many things similar to inx=OutputDataSet.DatetimeIndex.to_pydatetime() or inx=OutputDataSet.DatetimeIndex.to_pydatetime(format =''%y-%m-%d'') But I keep…
Ben Watson
  • 150
  • 2
  • 10
0
votes
0 answers

probelem plotting intraday stock price data with datetime index in pandas

I have a stock price time series data on a one-minute level frequency which I have loaded in in a pandas data frame and converted time index to DateTime index. when I plot prices I get a straight line in between the plot. but when I convert time…
sahil
  • 133
  • 1
  • 1
  • 6
0
votes
2 answers

DateTime Parse from multiple csv files

Searched myself silly, but couldn't find the answer. Basically I want to import a number of GPS files with the aim to know the location of each GPS at any given time. I wanted to use Panda's datetime index for this. What I can't seem to figure out…
Zoner
  • 37
  • 9