-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Hello!
I have 30 years of data for a watershed and want to find the wet, dry, and normal years.
For this, I am yearly summing the precipitation data. Then I want to calculate using SPI.
My question arises in frequency and scale.
Can I use freq=M and scale=12? However, this is wrong because it will use the first 12 data so the first months will be NaN...
So can I use freq=M and scale=1?
Or do I need to use freq_col? I honestly have no idea...
Thanks in advance to those who can help me!
df_yearly = df.resample('Y', on='Date').sum().reset_index()
df_SPI = calculate_spi(df_yearly, freq_col='Year')
def calculate_spi(df_yearly,freq_col):
spi_calculator = SPI()
spi_results = spi_calculator.calculate(
df_yearly,
date_col='Date',
precip_cols='Total',
freq_col=freq_col,
scale=12,
fit_type='lmom',
dist_type='gam'
)
return spi_results
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels