Python Forum
How to use cse insensitive condition in lambda expresion
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use cse insensitive condition in lambda expresion
#5
Just curious, If I do not have a "value" column, and I want to add the column in the same line and else condition:

df=pd.DataFrame({'Name':['NHAY', 'HAY','UTY','UIK', 'JUI','YTH'],'Status':['Pass','Running','pass(warning 0)','pass','fail','passed']})
df['value']=df.loc[df['Status'].str.contains('pass', case=False), 'value'] = 0 # Can I add else condition and new clolumn('value')here?
Reply


Messages In This Thread
RE: How to use cse insensitive condition in lambda expresion - by SriMekala - Jul-13-2019, 12:14 PM

Forum Jump:

User Panel Messages

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