Data manipulation with Pandas - Page Visits Funnel

Kindly, somone help me with this code. I’m doing data manipulation with Pandas, specifically the page visits funnel project. I’m doing it on Jupyter Notebook but it’s throwing a TypeError: unsupported operand type(s) for -: ‘str’ and ‘str’
However, on codecademy’s the same code runs without an error. What could be the issue?


all_data = visits.merge(cart, how = ‘left’).merge(checkout, how = ‘left’).merge(purchase, how = ‘left’)

all_data[‘time_to_purchase’] = all_data.purchase_time - all_data.visit_time


You can get that error by using the - operator with two strings, e.g.

'a' - 'b'

So have a careful look at the types involved in that expression as you seem to be working with something you did not expect.

My challenge is the same code I’ve written runs okay on codecademy but not on Jupyter Notebook.

Since it’s on your own system you’re going to need to do some debugging or provide more information for anyone to get the chance of helping you. Have you checked the types yet?

I have. Let me get back to it. Thanks