Seen this? TypeError: unsupported operand type(s) for /: 'SArray' and 'SArray'

User 190 | 9/2/2014, 5:04:28 PM

I'm trying to divide one column by the other in my function --> users[['engagementsperday']] = [users['engagements'] / users['days_online']]

and I keep getting that error...

It seems to work well in the iPython notebook, just not outside it..?

Comments

User 190 | 9/2/2014, 5:41:32 PM

Hey guys, I figured it out...

I had included "from future import division" at the top of the module.

As it turns out, this breaks the division operator for SArrays.


User 6 | 9/3/2014, 11:02:14 AM

Thanks for clarifying!