All Posts Create a Post  
0
votes
236
views
Negative time difference in Pandas
Posted at 4 months, 1 week ago / May 22, 2021, 6 a.m.

I get this strange result by substracting earlier time stamp for later one: pd.to_datetime('2021-05-21 06:00:00') - pd.to_datetime('2021-05-21 06:02:00') Output: Timedelta('-1 days +23:58:00') Expected Output: Timedelta('-0 days 00:02:00') What is the …

172 5 5 0
0
votes
98
views
Create a column based on the aggregation of values from multiple column at multiple row indexes
Posted at 4 months, 1 week ago / May 19, 2021, 8:17 a.m.

I’m trying to translate a technical analysis operator from another proprietary language to python as using dataframes, but I got stuck on a problem that seems rather simple, but I …

172 5 5 0
0
votes
142
views
In Pandas, giving a datetime index, with rows on all work days, how to determine if a row is beginning of week or end of week?
Posted at 4 months, 1 week ago / May 20, 2021, 6 p.m.

I have an set of stock information, with datetime set as index, stock market only open on weekdays so all my rows are weekdays, which is fine, I would like …

172 5 5 0
0
votes
90
views
How to sum specific columns while keeping the unique ID without nan
Posted at 4 months, 1 week ago / May 20, 2021, 6 a.m.

So my dataframe is- Name ID A B C Sam 11 1 1 1 Sam nan 0 1 4 Dan 12 1 4 4 Dan nan 1 5 0 Dan …

172 5 5 0