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

Error : it seems that related_queries[search] is NoneType in changepoint_date_analysis #28

Open
antoinecomp opened this issue Dec 3, 2018 · 1 comment

Comments

@antoinecomp
Copy link

antoinecomp commented Dec 3, 2018

Hi there ! I just found what I think is a little error:

# same method but with a search term
msci.changepoint_date_analysis(search = 'Microsoft profit')

...

Top Related Queries: 

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-21-4e46f891db49> in <module>
      1 # same method but with a search term
----> 2 msci.changepoint_date_analysis(search = 'Microsoft profit')

~\Documents\Programming\Luxurynsight\Finance\stocker.py in changepoint_date_analysis(self, search)
    779 
    780             print('\n Top Related Queries: \n')
--> 781             print(related_queries[search]['top'].head())
    782 
    783             print('\n Rising Related Queries: \n')

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

Another error was raised when running another query:

Top Related Queries: 

        query  value
0  msci index    100
1  msci china     67
2  msci world     56
3     msci 指數     28
4     msci 中國     28

 Rising Related Queries: 

        query  value
0     msci 中國    130
1  msci world     50
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-26-080452be5a00> in <module>
      1 # same method but with a search term
----> 2 msci.changepoint_date_analysis(search = 'msci')

~\Documents\Programming\Luxurynsight\Finance\stocker.py in changepoint_date_analysis(self, search)
    787             trends = trends.resample('D')
    788 
--> 789             trends = trends.reset_index(level=0)
    790             trends = trends.rename(columns={'date': 'ds', search: 'freq'})
    791 

C:\ProgramData\Anaconda3\lib\site-packages\pandas\core\resample.py in __getattr__(self, attr)
     95             return self[attr]
     96 
---> 97         return object.__getattribute__(self, attr)
     98 
     99     @property

AttributeError: 'DatetimeIndexResampler' object has no attribute 'reset_index'
@antoinecomp antoinecomp changed the title Error : it seems related_queries[search] is NoneType in changepoint_date_analysis Error : it seems that related_queries[search] is NoneType in changepoint_date_analysis Dec 3, 2018
@estkae
Copy link

estkae commented Jul 14, 2021

i have the same issue.
microsoft.changepoint_date_analysis(search..........

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