I am trying to count the number of days between dates (cumulatively), (grouped by a column denoted as id), however, I want to reset the counter whenever a condition is satisfied. I want to at the same time create a new column and add the values to that column for those particular rows. Additionally, I want to also count back
Tag: time-series
Plotly: How to highlight weekends without looping through the dataset?
I am trying to plot three different timeseries dataframes (each around 60000 records) using plotly, while highlighting weekends (and workhours) with a different background color. Is there a way to do it without looping through the whole dataset as mentioned in this solution. While this method might work, the performance can be poor on large datasets Answer I would consider
How to merge 2 dataframe by date and time in python pandas?
I want to match certain parts of 2 dataframes by date and time and merge them into one of them. But my code is not working. I have 2 dataframe df and df2. First is df and second is df2. What can I do for this? I want to add Weather, Temp, Feels and after that to df. here is
Converting a time series into start & end dates using Pandas
I’m simply looking for a more intuitive and faster way to get start and end times of uninterrupted time sequences. Here’s a reproducible example as well as my way of doing it for the time being: Resulting dataframe: Any kind of help will be valuable. Answer Another approach is to create a group column indicating which group each row belongs
InvalidArgumentError training multivariate LSTM autoencoder
I tried to do experiments in different datasets using this model, it works fine for univariate time series. However, I get an issue when trying to do it for multivariate time series and I think it’s due to Time Distributed layer but I am not sure. I tried to read different posts about the same question with no luck. trainx
Converting UTC time to local in python datetime.time [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 1 year ago. Improve this question My sample dataframe is: Here, the time are in UTC, I
What is the best practice to convert HTTP timestamps to standard format during dataframing using pandas in python?
I’m trying to convert HTTP timestamps into standard timestamp for complete data framing and getting time-series plots. I’m looking for an efficient way to do this for the large dataset. My actual data frame is as follows: I have tried couple of the following methods and get errors: This returns me NaT which is strange! I updated the format and
Merging time series data so that column values are fitted into dictionaries
I have two time-series data frames that track the same certain countries throughout the same amount of time, but the variables they track for each observation represent vastly different things. For example, the first data frame is like so: Tracking variable ‘A’: Country 01/01/2020 01/02/2020 01/03/2020 … 04/25/2021 AFG 0 0 1 … 5000 CHN 0 20 50 … 0
Reshape Python List to Match Input Layer (Data preprocessing – Keras – LSTM – MoCap)
Good Day, I am trying to train LSTM using multiple excel files (Motion Capture Data) as input. Each excel file represents a body motion, I would like to train the network using multiple motions in the training set and in the tests set. Below the example of a single excel file: As for the input shape, it’s (1, 2751, 93),
How to calculate relative frame values for events in a video or photo stack in Python?
I have a dataframe with: column 1 : a list of particles column 2: the frame in which they are observed in a video column 3: measurement x I need to compare the particles’ measurements over the time they are visible in the video. I cannot use the frame directly, since I need it to be relative to the first