Addition subtraction of integers and integer-arrays with Timestamp is no longer supported Instead of adding subtracting n use n obj freq

0 votes

I am trying to gather google trends using pytrends library, but I am getting the error in the title "Addition/subtraction of integers and integer-arrays with Timestamp is no longer supported. Instead of adding/subtracting n, use n * obj.freq".

This is my code:

timeframes = []
datelist = pd.date_range('2004-01-01', '2020-01-01', freq="AS")
date = datelist[0]
while date <= datelist[len(datelist)-1]:
    start_date = date.strftime("%Y-%m-%d")
    end_date = (date+4).strftime("%Y-%m-%d")
    timeframes.append(start_date+' '+end_date)
    date = date+3

What is it I am doing wrong?

Aug 8, 2022 in Python by krishna
• 2,820 points
3,042 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
0 answers

what is the use of args and kwargs in python?

can you an example for each? READ MORE

May 11, 2019 in Python by Waseem
• 4,540 points
718 views
0 votes
1 answer

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Hello @kartik, Since different users might have different ...READ MORE

answered Jun 15, 2020 in Python by Niroj
• 82,840 points
23,375 views
0 votes
1 answer

Error is '<' not supported between instances of str and int

your dis is obviously not 1.13, it's ...READ MORE

answered Nov 15, 2020 in Python by Gitika
• 65,770 points
5,588 views
0 votes
0 answers

The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I couldn't figure out the problem. here my ...READ MORE

Dec 17, 2020 in Python by muammer
• 120 points
7,782 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,464 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP