Skip to content

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

@Talented-Business

Description

@Talented-Business

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions