LiquidSnake
LiquidSnake

Reputation: 380

Forecasting datas, how to handle missing datas?

I'm having issues using ARIMA for forcasting a time series. I have data with missing values and I need to have them to apply ARIMA on it, how can I do it ?

Here's an example of how the data looks:

City  utc_time Meteo(degrees)
A     12:00:00 21 
A     13:00:00 21
A     14:00:00 22
A     15:00:00 31 
A     16:00:00 
A     17:00:00 28
A     18:00:00 
A     19:00:00 
A     20:00:00

Upvotes: 0

Views: 1148

Answers (2)

Irene
Irene

Reputation: 111

This worked for me:

df["Meteo(degrees)"] = df["Meteo(degrees)"].fillna(df["Meteo(degrees)"].bfill())

Upvotes: 0

Dav2357
Dav2357

Reputation: 134

You may also consider .interpolate() as follows:

df["Meteo(degrees)"].interpolate(method="linear")

and pick the method that you prefer. Docs here

Upvotes: 1

Related Questions