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
1
vote
1 answer

FeatureTools: Can there be multiple columns in time_index parameters?

I have 2 time paramaters in a dataframe i.e. start_date and end_date and both are time parameters when one creates a entityset from a dataframe. While specifying the time_index, can we specify 2 different columns? I don't want to create a new column…
Ganesh Bhat
  • 295
  • 7
  • 20
1
vote
1 answer

Expanding DatetimeIndex to rows in Python pandas

I have a pandas dataframe with 3 columns DateIndex, Country, and Awareness I need to convert the DateIndex to individual date entries per row. Input: Country Awareness DateIndex USA 50% DatetimeIndex(['2017-05-01', '2017-05-02', '20... UK …
user2419259
  • 93
  • 1
  • 8
1
vote
3 answers

Get averages for DateTimeIndex periods, then re-distribute them to the original dataframe column

I have lovely code that makes a list of averages of all entries on a given timeindex period. For example, on a dataframe with ten years of data, it will return the average values for each day of the week. What I want to do is propagate these average…
DK.
  • 43
  • 1
  • 1
  • 6
1
vote
1 answer

Indexing datetime column in pandas

I imported a csv file in python. Then, I changed the first column to datetime format. datetime Bid32 Ask32 2019-01-01 22:06:11.699 1.14587 1.14727 2019-01-01 22:06:12.634 1.14567 1.14707 2019-01-01 22:06:13.091 …
SaeedMMX
  • 23
  • 1
  • 7
1
vote
1 answer

Pandas gives integer from datetime index with item()

I have 2 dataframes, taken from a larger frame (with df.head(x) ), both with the same index: print df val DT 2017-03-06…
ajsp
  • 2,512
  • 22
  • 34
1
vote
1 answer

Get every nth weekday of month periodic in pandas

I need to generate an array of dates at specific intervals. for example every 3 sunday of the month: [2019-02-17, 2019-03-17, 2019-04-21] Is it possible to do this using standard pandas functions? For example, specifying some particular freq…
Иван
  • 87
  • 1
  • 7
1
vote
0 answers

Pandas "DatetimeIndex" is not accurately converting datetime

I have a minute dataset from: 01.01.2017 00:00:00.000 to 06.10.2017 23:59:00.000 It looks like this: Gmt time, Open, Close 01.01.2017 00:00:00.000, 1.05148, 1.05153 01.01.2017 00:01:00.000, 1.05148, 1.05153 01.01.2017 00:02:00.000, 1.05148,…
floss
  • 2,603
  • 2
  • 20
  • 37
1
vote
2 answers

pd.DatetimeIndex keep returning the wrong month

I am reading data from a csv file, and I have a Date column formatted as "dd/mm/yyyy". I just want to extract the month from it. The problem is that in some cases (based on my observation it is when dd > 12), it returns the month correctly.…
Nour
  • 197
  • 1
  • 3
  • 13
1
vote
1 answer

Pandas time re-sampling categorical data from a column with calculations from another numerical column

I have a data-frame with a categorical column and a numerical , the index set to time data df = pd.DataFrame({ 'date': [ '2013-03-01 ', '2013-03-02 ', '2013-03-01 ', '2013-03-02', '2013-03-01 ',…
Fizmath
  • 13
  • 4
1
vote
2 answers

select dataframe rows (datetimeindex) by a list of datetime.date

the df looks like this: DateTime 2017-07-10 03:00:00 288.0 2017-07-10 04:00:00 306.0 2017-08-10 05:00:00 393.0 2017-08-10 06:00:00 522.0 2017-09-10 07:00:00 487.0 2017-09-10 08:00:00 523.0 2017-10-10 09:00:00 585.0 Question how…
Chao TANG
  • 13
  • 1
  • 3
1
vote
2 answers

Replace NaN in pandas DataFrame at certain dates (upsampling)

I'm new to python and I'm struggeling with the following example: I have a pandas DataFrame with a dateTime-Index and a column with feastdays. This is in daily resolution. import pandas as pd import holidays hd =…
M. Schmid
  • 79
  • 7
1
vote
1 answer

Force to use DatetimeIndex with Pandas

I have the following Pandas dataframe: df.head() Output id unplug_hourDateTime 0 2018-09-01 01:00:00+02:00 1 2018-03-01 01:00:00+02:00 2 2018-03-01 01:00:00+02:00 3 2018-04-01 01:00:00+02:00 4 2018-04-01 01:00:00+02:00 My objective is…
Nicolaesse
  • 2,554
  • 12
  • 46
  • 71
1
vote
0 answers

Pandas: What determines the return type of DatetimeIndex.intersection?

I have two Dataframes with timezone-aware DatetimeIndices, let's call those A und B. There is a difference between the DatetimeIndices, because I converted A to UTC while B is already in UTC and won't let me use tz_localize as it's already…
Medusa
  • 593
  • 2
  • 5
  • 18
1
vote
1 answer

How to correlate columns from two different dataframes with datetimeindex

I am trying to correlate the same column in two different dataframes (same size). The dfs use stock data with a datetimeindex. Every possible correlation I can come up with only gives NaN for an answer. Is the dtype of the df indees messing…
bud fox
  • 335
  • 3
  • 16
1
vote
2 answers

Add new Datetime to Datetime Index Pandas dataframe with value

Here is my first dataframe df1, Open High Low Close Date 2018-07-16 2797.360107 2801.189941 2793.389893 2798.429932 2018-07-17 2789.340088 2814.189941 2789.239990 2809.550049 2018-07-18 …