Python Forum
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If Then statement
#19
(Apr-24-2017, 07:59 PM)zivoni Wrote:
(Apr-24-2017, 07:16 PM)smw10c Wrote: When I try df3['initial cost'][df3['initial cost'] < 0] = NaN, the error I get is: TypeError: '<' not supported between instances of 'str' and 'int'
Did you convert df3['initial cost'] to numeric dtype, as was mentioned before? Do not worry about not posting quote/response aligned, it takes some time to learn editor (but using Preview Post button helps a lot)

Thank you! That was the issue. I forgot to convert it to numeric type. Thanks again for bearing with me.
Reply


Messages In This Thread
If Then statement - by smw10c - Apr-24-2017, 03:15 PM
RE: If Then statement - by wavic - Apr-24-2017, 03:45 PM
RE: If Then statement - by nilamo - Apr-24-2017, 03:55 PM
RE: If Then statement - by zivoni - Apr-24-2017, 04:15 PM
RE: If Then statement - by nilamo - Apr-24-2017, 04:18 PM
RE: If Then statement - by zivoni - Apr-24-2017, 04:27 PM
RE: If Then statement - by smw10c - Apr-24-2017, 04:30 PM
RE: If Then statement - by nilamo - Apr-24-2017, 04:39 PM
RE: If Then statement - by smw10c - Apr-24-2017, 04:41 PM
RE: If Then statement - by zivoni - Apr-24-2017, 05:08 PM
RE: If Then statement - by smw10c - Apr-24-2017, 05:17 PM
RE: If Then statement - by snippsat - Apr-24-2017, 04:19 PM
RE: If Then statement - by smw10c - Apr-24-2017, 04:25 PM
RE: If Then statement - by zivoni - Apr-24-2017, 04:47 PM
RE: If Then statement - by smw10c - Apr-24-2017, 04:55 PM
RE: If Then statement - by zivoni - Apr-24-2017, 05:35 PM
RE: If Then statement - by smw10c - Apr-24-2017, 07:16 PM
RE: If Then statement - by zivoni - Apr-24-2017, 07:59 PM
RE: If Then statement - by smw10c - Apr-24-2017, 08:10 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020