Skip to content
Advertisement

Tag: time-series

Python: Matplotlib avoid plotting gaps

I am currently generating the plot below: with this code: where intra.to_pydatetime() is a: <bound method DatetimeIndex.to_pydatetime of <class ‘pandas.tseries.index.DatetimeIndex’> [2011-01-03 09:35:00, …, 2011-01-07 16:00:00] Length: 390, Freq: None, Timezone: None> So the dates go from 2011-01-03 09:35:00, increments by 5 minutes until 16:00:00, and then jumps to the next day, 2011-01-04 09:35:00 until 2011-01-04 16:00:00, and so on. How

auto.arima() equivalent for python

I am trying to predict weekly sales using ARMA ARIMA models. I could not find a function for tuning the order(p,d,q) in statsmodels. Currently R has a function forecast::auto.arima() which will tune the (p,d,q) parameters. How do I go about choosing the right order for my model? Are there any libraries available in python for this purpose? Answer You can

How to split a pandas time-series by NAN values

I have a pandas TimeSeries which looks like this: I would like split the pandas TimeSeries everytime there occurs one or more NaN values in a row. The goal is that I have separated events. I could loop through every row but is there also a smart way of doing that??? Answer You can use numpy.split and then filter the

Compute daily climatology using pandas python

I am trying to use pandas to compute daily climatology. My code is: cum_data is the data frame containing daily dates from 1st Jan 1950 to 31st Dec 1953. I want to create a new vector of length 365 with the first element containing the average of rand_data for January 1st for 1950, 1951, 1952 and 1953. And so on

Sliding window of M-by-N shape numpy.ndarray

I have a Numpy array of shape (6,2): I need a sliding window with step size 1 and window size 3 like this: I’m looking for a Numpy solution. If your solution could parametrise the shape of the original array as well as the window size and step size, that’d be great. I found this related answer Using strides for

Advertisement