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

how to convert index to datetime without miliseconds in pandas

i have a data frame whose index i want to convert to a datetime format: %Y%m%d%H:%M:%S. i have tried the following code: pd.to_datetime(dfn.index,origin=pd.Timestamp('2012-01-01 00:00:00')) but the DateTime format returned attributed the value of…
vichel
  • 1
  • 2
0
votes
1 answer

How to sort only a DatetimeIndex?

I have a DatetimeIndex like this. DatetimeIndex(['2015-04-29 00:00:00', '2016-02-22 16:00:00', '2016-02-12 04:00:00', '2016-02-16 04:00:00', '2016-02-09 12:00:00', '2016-02-11 07:00:00', '2015-08-06…
Benoid
  • 209
  • 1
  • 4
  • 11
0
votes
1 answer

How to find out shift of Timeindex in another dataframe?

I got 2 Dataframes. The first has a Timeindex and a Timecolumn. The second has a Timeindex, but its columns are irrelevant. Both timeindex are sorted in timeorder, but dont have a regularity inside. (e.g. holidays or specific dates are left out) Now…
Benoid
  • 209
  • 1
  • 4
  • 11
0
votes
1 answer

How to join two data frames, one with a date time index and the other with normal indexing

I have a data frame with a date index in the form of YYYY-MM-DD and another data frame with normal indexing, they both have the same number of rows and i want to join the two data frames. Join and merge functions don't work, concat function changes…
0
votes
1 answer

Key error in plotting hourly time-series data

I am trying to plot a time-series data hourly. col1 col2 col3 col4 col5 col6 col7 DateTime 2018-09-26 00:00:00 25502921 0 44.677500 0.0 0.0 0.0 …
raaj
  • 403
  • 1
  • 5
  • 17
0
votes
1 answer

Pandas: convert timeseries columns to multi-index with DatetimeIndex

I have a csv file/dataframe of a time series that looks like this: IDX_A IDX_B 1/1/20 1/2/20 1/3/20 A 1 A1_0 A1_1 A1_2 A 2 A2_0 A2_1 A2_2 B 3 B3_0 B3_1 B3_2 B 4 B4_0 B3_1 …
jml-happy
  • 47
  • 1
  • 2
0
votes
1 answer

Slicing a datetimeindex dataframe

I'm new to python and pandas. I'm trying to code something in which I compared the second last row of a pandas dataframe indexed by datetime with the last row of the dataframe. However, I am having trouble trying to get the index to compare…
0
votes
1 answer

How do I turn a list of timestamps into a list of strings?

I have a list of dates that are datetime64 objects. I want to compare these dates to a larger list of dates that are in string format: large_list = ['2019-12-30', '2019-12-31', '2020-01-01', '2020-01-02'] #etc... smaller_list = [2019-12-30 00:00:00,…
0
votes
1 answer

How to create the difference set of several DatetimeIndex objects (pandas)?

I couldn't find another thread with the exact same question, so I hope, I'm not opening too much of the same old one. I'm just learning to work with pandas and date time objects and I'm looking to create a big DatetimeIndex object with a range of…
CptSnuggles
  • 137
  • 1
  • 3
  • 11
0
votes
1 answer

Gaps in data series with pandas datetimeindex

I have a pandas dataframe with the following DatetimeIndex: DatetimeIndex(['2019-06-13 15:30:00', '2019-06-13 15:31:00', '2019-06-13 15:32:00', '2019-06-13 15:33:00', .... '2020-03-06 21:56:00',…
Mark T
  • 145
  • 4
  • 12
0
votes
1 answer

add 10 step at the end of a datetimeindex

I creat a df with datetimeindex like this index value 2020-03-04T16:00:00.000000000 5 2020-03-04T16:05:00.000000000 8 2020-03-04T16:10:00.000000000 4 2020-03-04T16:15:00.000000000 1 I want…
Jonathan Roy
  • 405
  • 1
  • 6
  • 18
0
votes
1 answer

Assigning my own date to Date Column of format HH:MM:SSS.000 in Pandas

I have data logging to a csv file that has a timestmap in the form HH:MM:SSS.000. Raw Data Image . I when I read this data into pandas via this line of code it is automatically adding today's date into the column from the parse_dates function…
Z-Access
  • 3
  • 1
0
votes
0 answers

Pandas get_loc with datetimeindex failing

I have a time-indexed dataframe, and I want to find what row number matches the closest time to a given time. For example,: import pandas as pd findtime = pd.Timestamp('2019-12-12 10:19:25', tz='US/Eastern') start = pd.Timestamp('2019-12-12 0:0:0',…
Andrew
  • 1
  • 1
0
votes
2 answers

Chanding a dataframe values from int type to date

I have the following dataframe df = pd.DataFrame({ 'date': [1988, 1988, 2000, 2005], 'value': [2100, 4568, 7896, 68909] }) I want to make a time series based on this df. How can i change the year from int to a datetimeindex so i can plot a…
Tamarie
  • 125
  • 2
  • 6
  • 18
0
votes
1 answer

How can i make a join on datetimeindex using pandas?

Why pandas does not let me make a join on datetimeindex? Here is a small code block to produce the issue that i am having. dti = pd.date_range('2019-01-01','2020-01-01') df1 = pd.DataFrame({'date':dti}) df2 =…
moth
  • 427
  • 1
  • 4
  • 18