Skip to main content

All Questions

Tagged with
-3 votes
1 answer
46 views

Dataframe merge overlapping dates

I have a question where I need to merge two dataframes whose values(masked) are given as dds is a dataframe and its data is STATE START_DATE END_DATE data_val Alabama 04/01/2021 06/15/2021 x ...
NEWBIE's user avatar
  • 1
4 votes
3 answers
143 views

Merge 3 dataframes with different timesteps (10min and 15min and 30min) using pandas

The goal is to merge three different dataframes having different timesteps (10min, 15min and 30min. The code must recognize what timestep to consider firstly and identify the next available next ...
JASS's user avatar
  • 65
0 votes
1 answer
26 views

How to create dataframe of conflicting shifts in Pandas?

I have two dataframes: filled_shifts: Worker ID Position Name Start Date Start Time End Date End Time 0 00ul13zkpiYemBsW10x7 Remote CC - Tasks 2020-07-27 5:00:00 ...
grungrun's user avatar
1 vote
1 answer
32 views

Merging on DatetimeIndexes and on = ''

I have two pandas data frames, that I need to merge on both indexes and one other variables. Like this, import pandas as pd import numpy as np n = 9 df1 = pd.DataFrame({ "ctr": np....
Eric Fail's user avatar
  • 7,978
0 votes
0 answers
45 views

How can i convert 31 colums (refering to the days of month) into a single datetime column?

I have this: Febuary_Sells (31 columns refering to the days of month) Store | Product | 1 | 2 | 3 | 4 | 5 | ... | 31 | Store 1 | Iphone | 0 | 3 | 1 | 3 | 2 | ... | 0 | Store 1 | 4k TV | 1 ...
fgu1lherme's user avatar
1 vote
1 answer
43 views

how to match datetime pandas column with range of times in another datetime column

I have df1 with columns 'Reported Date' and 'order',df2 has columns 'lastoccurance' and 'orders', I want to merge df1 and df2 with condition lastoccurrence = Reported date+ or - 30 minutes(range of -/+...
asmaa mahmoud's user avatar
0 votes
0 answers
85 views

Inconsistent Timestamp format when merging to dataframes [duplicate]

I am merging two dataframes, both have a Timestamp format DD.MM.YYYY. But when I merge them, some rows have format MM.DD.YYYY and others DD.MM.YYYY. The dataframes I'm using are being exported from ...
snkm's user avatar
  • 27
2 votes
1 answer
68 views

Pandas. Collapse rows with a certain time difference by summing data in other columns

I have a table with time points (timestamp). If less than a minute has passed between the points, I need to sum the timedelta and update the point's datetime boundaries. For the rows where 'time_break'...
vasssabi96's user avatar
1 vote
1 answer
48 views

how to merge values onto dates of a dataframe by the hour given intervals between days pandas

so I have constructed weights for values between specific timestamps in pandas. I want to be able to assign these weights to another dataframe that has datetime objects with values down to the hour. ...
finman69's user avatar
  • 311
1 vote
1 answer
40 views

Python merge by closest date for a particular client

I am new on Python and I thank you therefore for your help. Here is my dF : df = pd.DataFrame{'Id': {0: 'ae9b0886-7e2b-4c37-a3a3', 1: 'ae9b0886-7e2b-4c37-a3a3', 2: 'ae290c85-9dfb-440f-becb', 3: '...
Nicolas Eloy's user avatar
1 vote
2 answers
35 views

Joining values indexed by date and time with irregular measurements

I have two dataframes, both with a timestamp and some measurement; let's say measurement X and Y. I'd like to join these on their date/time index to compare the measurements but their timestampss are ...
Bas R's user avatar
  • 185
0 votes
1 answer
369 views

Including a lag specification in a pandas merge based on datetime column

I am merging a column from one dataframe with a larger one based on date column. With this code: df_final = pd.merge(df_final, pmms_df, how='left', on='PredictionDate') pmms_df looks like this: ...
Hefe's user avatar
  • 439
-2 votes
1 answer
46 views

How to group sequence based on group column assign a groupid

Below is the dataframe I have ColA ColB Time ColC A B 01-01-2022 ABC A B 02-01-2022 ABC A B 07-01-2022 XYZ A B 11-01-2022 IJK A B 14-01-...
python_interest's user avatar
0 votes
2 answers
58 views

Append a row of df2 to existing df 1 if 2 conditions apply

So I have the following two data sets: df1: index datetime team other conditions 1 2013-4-1 team a 73.3 2 2013-4-1 team b 34.5 3 2014-3-12 team c 57.2 df2: index datetime home away other conditions 1 ...
Edgar Schwarz's user avatar
1 vote
1 answer
84 views

Merge dataframes by dates

I have got the below 2 df: lst=[['2021-01-01','A'],['2021-01-01','B'],['2021-02-01','A'],['2021-02-01','B'],['2021-03-01','A'],['2021-03-01','B']] df1=pd.DataFrame(lst,columns=['Date','Pf']) lst=[['...
Bsleon's user avatar
  • 135

15 30 50 per page
1
2 3 4 5