You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AttributeError: 'NoneType' object has no attribute 'loc'
The text was updated successfully, but these errors were encountered:
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
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'
The text was updated successfully, but these errors were encountered: