Closed nehagupta891 closed 6 months ago
Hi,
Pandas 2.2.0 deprecated the frequencies "Y" and "Q". You now have to explicitly ask for "YS" or "YE" (and "QS" or "QE").
I re-ran and push the example notebook to reflect the changes. Let me know if you still have problems.
Hi,
Pandas 2.2.0 deprecated the frequencies "Y" and "Q". You now have to explicitly ask for "YS" or "YE" (and "QS" or "QE").
I re-ran and push the example notebook to reflect the changes. Let me know if you still have problems.
Thanks for the quick answer. I now get the following problem when I run your code:
ValueError: Invalid frequency AS-JAN
Make sure you have updated ts_disagg to version 1.1. You should be using YS, not AS, as AS has been depreciated.
Hi, I have checked and updated it to version 1.1. I also have used YS (haven't changed anything from your notebook), I get this error:
ValueError Traceback (most recent call last) ----> 1 sales_q_denton = disaggregate_series( 2 sales_a.resample("YS").last(), target_freq="QS", method="denton", agg_func="sum" 3 )
323 target_idx = np.flatnonzero(low_freq_df.columns == target_column)[0]
324
--> 325 df, C_mask, time_conversion_factor = prepare_input_dataframes( 326 low_freq_df, high_freq_df, target_freq, method 327 )
231 )
232
--> 233 df, C_mask = align_and_merge_dfs(df1_out, df2_out) 234 if no_high_freq_data: 235 C_mask = None
259
260 def align_and_merge_dfs(low_freq_df, high_freq_df):
--> 261 C_mask = handle_endpoint_differences(low_freq_df, high_freq_df) 262 df = pd.merge(low_freq_df, high_freq_df, left_index=True, right_index=True, how="outer") 263
245
246 # these are stored as adverbs (e.g. yearly), so remove the -ly suffix
--> 247 attr = get_frequency_name(low_freq)[:-2] 248 249 low_freq_idx = getattr(low_freq_df.index, attr)
67 return "monthly"
68
---> 69 raise ValueError(f"Invalid frequency {freq}") 70 71
ValueError: Invalid frequency AS-JAN
What version of pandas are you using
Issue is solved, I needed to update pandas
Awesome, thanks!
I'll update the requirements to prevent usage with pandas<2.2.0
sales_q_denton = disaggregate_series( sales_a.resample("Y").last(), target_freq="Q", method="denton", agg_func="sum" )
I have downloaded your notebook and tried many different things but your lines for the actual calculation don't seem to work. I get this error: NotImplementedError: Only annual, quarterly and monthly frequencies are supported, found
What's going wrong?