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

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

Open
benji931122 opened this issue Nov 21, 2023 · 3 comments
Open

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

benji931122 opened this issue Nov 21, 2023 · 3 comments

Comments

@benji931122
Copy link

I am using the following code and the error persists. The thing is that a week ago the code was working just fine with the exact same Dataframe:

import pandas as pd
from causalimpact import CausalImpact


data = pd.read_csv('https://raw.githubusercontent.com/WillianFuks/tfcausalimpact/master/tests/fixtures/arma_data.csv')[['y', 'X']]
data.iloc[70:, 0] += 5

pre_period = [0, 69]
post_period = [70, 99]

ci = CausalImpact(data, pre_period, post_period)
print(ci.summary())
print(ci.summary(output='report'))
ci.plot()

Pandas version is 2.1.3 and
causalimpact version is 0.2.6

@WillianFuks
Copy link
Owner

Hi @benji931122 ,

tfci does not have version 0.2.6. Apparently in your workflow at some point you are installing another ci package. tfcausalimpact should be present in your pip freeze and no other package with conflicting name should appear as well.

@benji931122
Copy link
Author

Thanks! It does show up only once when I do the pip freeze. What can I do to use this library as intended?

@WillianFuks
Copy link
Owner

So you'll have to uninstall the current package that you have and install again tfci via pip install -U tfcausalimpact. After that you could run: pip show tfcausalimpact and it should return something like

Name: tfcausalimpact
Version: 0.0.14
Summary: Python version of Google's Causal Impact model on top of Tensorflow Probability.
Home-page: https://github.com/WillianFuks/tfcausalimpact
Author: Willian Fuks
Author-email: willian<dot>fuks<at>gmail.com
License: Apache License 2.0
Location: path/to/package
Requires: jinja2, pandas, tensorflow, tensorflow-probability, matplotlib
Required-by: 

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