0

Here is my code:

 Depth['timing']=np.where((Depth['time_entry']== 'later' )| (Depth['offer_status']=='market'), Depth['time_status_change'],Depth['time_entry'])
    Depth2['timing']=np.where((Depth2['time_entry']== 'later' ) | (Depth2['offer_status']=='market'), Depth2['time_status_change'],Depth2['time_entry'])

Update: I solved it anyways, but used some stupid loop which is not very good for performance.

What I got is: invalid type comparison . What can I do to fix it? Depth['time_entry'] is a column with either a number or 'later', so maybe that is the issue?

Stoner
  • 846
  • 1
  • 10
  • 30
FARRAF
  • 205
  • 2
  • 8

1 Answers1

0

Try with converting Depth['time_entry'] in to string first and then validating against 'later'.

See this: datetime to string with series in python pandas.

CypherX
  • 7,019
  • 3
  • 25
  • 37