Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't get summury from date indexing data: 'NoneType' object has no attribute 'loc' #64

Open
Talented-Business opened this issue Jan 13, 2023 · 1 comment

Comments

@Talented-Business
Copy link

The source code is following. I ran example code in google colab.
import pandas as pd
from causalimpact import CausalImpact

data = pd.read_csv('https://raw.githubusercontent.com/WillianFuks/tfcausalimpact/master/tests/fixtures/comparison_data.csv', index_col=['DATE'])
pre_period = ['2019-04-16', '2019-07-14']
post_period = ['2019-7-15', '2019-08-01']
ci = CausalImpact(data, pre_period, post_period)

pd.version
1.5.2
print(ci.summary())

AttributeError Traceback (most recent call last)
in
----> 1 print(ci.summary())

/usr/local/lib/python3.8/dist-packages/causalimpact/analysis.py in summary(self, output, width, path)
727 confidence = "{}%".format(int((1 - alpha) * 100))
728 post_period = self.params["post_period"]
--> 729 post_inf = self.inferences.loc[post_period[0] : post_period[1], :]
730 post_point_resp = post_inf.loc[:, "response"]
731 post_point_pred = post_inf.loc[:, "point_pred"]

AttributeError: 'NoneType' object has no attribute 'loc'

@Talented-Business Talented-Business changed the title I can't get summury: 'NoneType' object has no attribute 'loc' I can't get summury from date indexing data: 'NoneType' object has no attribute 'loc' Jan 13, 2023
@maxbernyk
Copy link

had the same error, fixed it by running impact.run().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants