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

Fix interest_over_time warning #627

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danaiamirali
Copy link

With pandas==2.2.0, running an interest_over_time() request (a specific one is shown below) leads to the following FutureWarning error from pandas:

from pytrends.request import TrendReq

pytrend = TrendReq(hl='en-US', tz=360)

kw_list = ["D23"]

pytrend.build_payload(kw_list, timeframe='now 1-H')

interest_over_time_df = pytrend.interest_over_time()

print(interest_over_time_df)

C:\Documents\GitHub\Projects\pytrends\pytrends\request.py:266: FutureWarning: Downcasting object dtype arrays on .fillna, .ffill, .bfill is deprecated and will change in a future version. Call result.infer_objects(copy=False) instead. To opt-in to the future behavior, set pd.set_option('future.no_silent_downcasting', True)
df = df.fillna(False)

This PR fixes the appearance of this warning with a one line addition.

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

Successfully merging this pull request may close these issues.

1 participant