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 DatetimeIndex to tuple?

I have a list as below. How can I convert to tuple format? Please somebody help me! [As-is] DatetimeIndex(['2000-01-01 00:00:44'], dtype='datetime64[ns]', freq=None) [To-be] (2000,01,01)
SJJ
  • 25
  • 3
0
votes
1 answer

Merging Dataframes in Python without changing index of first df

Not sure why it's not showing tables for df1 and df2 in main post. I am able to see it in preview. I have two data frames df1 and df2. df1 has one column (row_no) and a DateTime index with freq = 'S'. df2 has normal indexing and has two columns…
DevrajR
  • 1
  • 1
0
votes
1 answer

Mapping one dataframe to anther based on date column and index

I have two dataframes that I want to combine to add col SLR from df2 to df1 based on the datetimeindex in df1 and the datetime column in df2. The code below works, but I keep getting an error that I need to fix df1: datetimeindex name val…
user11958450
  • 109
  • 1
  • 7
0
votes
1 answer

pandas: convert time to timezone into new column

In a dataframe I'm trying to calculate a third column row wise from a time value column and one with a time zone. Unfortunately without success. df.time_gmt = pd.DatetimeIndex(df.time_gmt, tz='utc') #given …
its_me
  • 5
  • 3
0
votes
1 answer

How to add zero values to datetime-indexed Pandas dataframe, e.g. for subsequent graphing

I have the following Pandas datetime-indexed dataframe: date_time category num_files num_lines worst_index 2022-07-15 23:50:00 black 2 868 0.01 2022-07-15 23:50:00 red 5 5631 0.01 2022-07-15 23:50:00 green 1 1891 0.00 2022-07-15…
Mr.Rulez
  • 25
  • 1
  • 5
0
votes
1 answer

Problems parsing in datetime index

I am practicing on the manufacturing data set by the St. Louis Fed. Here, I would like to find out how many months it took for the peak in 2008 to be reached again. To do that, I have written the following code: # Set DATE as index and convert to…
Herr San
  • 41
  • 8
0
votes
1 answer

System Crash Using pandas for datetimeindex

I'm trying to work my way through this RealPython tutorial on the Python visualization package called bokeh https://realpython.com/lessons/using-columndatasource-object/#transcript . This video version is 2.5 years old, and the text version that…
Malik A. Rumi
  • 1,855
  • 4
  • 25
  • 36
0
votes
2 answers

Lexsorting Pandas Multi-Index with datetime index and string index

I have created a number of dataframes, all with varied overlapping datetime indexes. I then append them to each other, and append a second index, the "name" column. i try to get a slice of the dataframe by the entry in name, but it says it is not…
Fred Smith
  • 23
  • 5
0
votes
1 answer

How to generate datetimeindex for 200 observations per second?

I have data from many sensors, and observations come 200 times every second. Now I want to resample at a lower rate, so make the dataset manageable calculation wise. But The time column is absolute and date time. Please see the first column below.…
0
votes
0 answers

What is the best way to select rows within a date range from a timeseries dataset in a pandas dataframe?

I'm working with CRYPTO_INTRADAY timeseries data from the AlphaVantage API. JSON format: {'Meta Data': {'1. Information': 'Crypto Intraday (15min) Time Series', '2. Digital Currency Code': 'ZEC', '3. Digital Currency Name': 'Zcash', '4. Market…
dsx
  • 167
  • 1
  • 12
0
votes
1 answer

Pandas DateTimeSlicing for specific months per year

I was reading a lot of stuff about pandas and date time slicing but I haven't found a solution for my problem yet. I hope you could give me some good advices! I have a data frame with a Datetimeindex and for example a single column with floats. The…
TommiWe
  • 1
  • 2
0
votes
1 answer

how to drop rows having a specific time in datatime index

How can I remove the whole row from the dataframe where the datetime column is having 07:15 time in the datetime column.
0
votes
0 answers

Pandas dataframe replace values with the day before value

I'm trying to replace values based on condition with the day before value my code: import pandas as pd import random d = { 'year' : [2000,2000,2000,2001,2001,2001], 'month' : [1,1,1,2,2,2], 'day' : [1,1,1,2,2,2], 'ghi':…
Geralt
  • 3
  • 2
0
votes
1 answer

Round all index to 30 min in Pandas datetimeindex

I know about round, ceil, floor functions. df.index.round("30min") This rounds to the nearest 30 minute interval. What I want is that each is rounded to 30 minutes. In the case of .round 10:15 will be rounded to 10:30 and 10:45 to 11:00. I would…
Borut Flis
  • 15,715
  • 30
  • 92
  • 119
0
votes
1 answer

Extracting time interval by minute and hour in a particular day using datetimeindex of pandas

Suppose we have a dataframe including time indices and we want to extract only a dataframe including 10:23 to 14:34. How can we do this? n =1000 i = pd.date_range('2018-04-09', periods=n, freq='1min') ts = pd.DataFrame({'A': [i for i in range(n)]},…
Saeed
  • 598
  • 10
  • 19