time-series

pandas calculate returns batween two dates for multiple data points

pandas calculate returns batween two dates for multiple data points Question: I have a dataframe with the following columns: Date Identifier Price 28/02/2023 BBA LIBOR USD 3 MONTH 55 31/01/2023 BBA LIBOR USD 3 MONTH 63 28/02/2023 BBA LIBOR USD 1 Month 32 31/01/2023 BBA LIBOR USD 1 Month 59 28/02/2023 MSCI All Country World …

Total answers: 2

how to get total elapsed time in timeseries pandas dataframe for each group?

how to get total elapsed time in timeseries pandas dataframe for each group? Question: I want to calculate elapsed time in min for each group in my dataframe. for example, I have following data frame, i want to calculate total elapsed time for each group "foo" and "bar". data = pd.DataFrame( { "name": ["foo", "foo", …

Total answers: 1

How to merge data in DataFrame in overlapping time periods in pandas?

How to merge data in DataFrame in overlapping time periods in pandas? Question: I have a pandas DataFrame like the following: start_time status duration 0 2023-03-16 01:30:00 OK 0 days 00:02:00 1 2023-03-16 01:31:00 WARN 0 days 00:19:28 2 2023-03-16 01:31:00 ERROR 0 days 00:09:28 3 2023-03-16 01:32:00 ERROR 0 days 00:03:00 4 2023-03-16 01:33:00 …

Total answers: 2

How to make sure timerseriesAI/tsai uses GPU

How to make sure timerseriesAI/tsai uses GPU Question: I am using tsai 0.3.5 for timeseries classification. But it is taking unusual time for training an epoch. Can somebody please let me know how to make sure that tsai uses GPU and not CPU. Please find below my code. import os os.chdir(os.path.dirname(os.path.abspath(__file__))) from pickle import load …

Total answers: 1

Timeseries pandas changing name columns IndexError: too many indices for array

Timeseries pandas changing name columns IndexError: too many indices for array Question: IMAGE OF THE DATASET I had dates in one column, set them as a time series, and then transposed them so that each year has its own column. Some columns have the correct year, but the wrong date. I would like to set …

Total answers: 2

How to find maximum outer time span and append?

How to find maximum outer time span and append? Question: I would like to find for each ID, earliest measurement time before 00:00:00 and latest measurement time after 00:00:00. So that I can choose maximum overlapping start and ending time. Here is the sample data: import pandas as pd # create sample dataframe df = …

Total answers: 3

How to find overlapping time start and end points?

How to find overlapping time start and end points? Question: I would like to find for each ID, earliest measurement time before 12:00:00 and latest measurement time after 12:00:00. So that I can choose maximum overlapping start and ending time. Here is the sample data: import numpy as np import pandas as pd import random …

Total answers: 1

Unwanted white "grid" lines using axvline

Unwanted white "grid" lines using axvline Question: I have the following code: for df in dfs: plt.plot(df[‘Digital’], lw=5, label=’A’, zorder=2) plt.plot(df[‘Analog’], lw=2, linestyle=’–‘, label=’B’, zorder=2) for rowNr in np.arange(len(df)): if df.iloc[rowNr][‘Analog’] >= 0: plt.axvline(df.index[rowNr], ymin=0.08, color=’gray’, alpha=0.3, zorder=1) plt.ylim(-2, 25) This gives me the following result: I want to get rid of all the vertical …

Total answers: 1

How to reduce jitter in data?

How to reduce jitter in data? Question: I have trained a generative adversarial network to generate time series. On the left you see the original time series and on the right the generated one As you can see they are similar but I recognized that the generated one has a lot of up/down trends within …

Total answers: 1

Merging of multiples time series

Merging of multiples time series Question: Today I tried to merge multiples time series, corresponding to clinical recording (Heart rate, Arterial Pressure…), to make TSfresh analysis. Some of this have the same time step, and other have different one, like this : df1 = df1 = pd.read_csv("PATH", delimiter=’t’, header=None, index_col=0) Values Date 06/03/2021 17:22 30 …

Total answers: 1