dowhy icon indicating copy to clipboard operation
dowhy copied to clipboard

Warnings using causal.model

Open Manwithoutmind opened this issue 8 months ago • 4 comments

When using causal model, I've got warnings:

"the default of observed=False is deprecated and will be changed to True in a future version of pandas..." in causal_estimator.py line 266. After adding keyword "oberved=True" warning disappear

In a second "due to key in a future will be use as labels : use ser.iloc[0]" in regression_estimator.py line 131 after change parameter = self.model.params[0] with self.model.params.iloc[0] warning disappear.

Am I true, I'm not certain, but the job was done....

Manwithoutmind avatar May 03 '25 15:05 Manwithoutmind

thanks for noting these @Manwithoutmind will be great if you can add a pull request with these changes? For the first issue, since the default was observed=False, shall we keep the same one?

amit-sharma avatar May 05 '25 06:05 amit-sharma

Hi Amit-sharma. OK I will add a pull request (I just need to have a look to the HowTo...)

For the first issue, in some days the default will be observed=True... (but when ?) and It's look a little stupid to change it now. But, without doing it, I get a lot of warning and can't read anything on my screen, so.... (maybe change it a little bit the code with testing the version newest/oldest of Pandas ???)

Manwithoutmind avatar May 05 '25 18:05 Manwithoutmind

I'm still getting this too after the last release. In one of my work projects I discovered that this warning occured when pandas "groupby" was being used in my code.

ethantenison avatar Jul 20 '25 15:07 ethantenison

thanks for letting me know @ethantenison . Let me look at the latest release and check for these warnings.

can you share a minimum working example or the code snippet at which you get this warning?

amit-sharma avatar Jul 20 '25 16:07 amit-sharma