selected_columns_df['SR Status'] = selected_columns_df['SR Status'].astype(str)
if selected_columns_df['SR Status'].str.lower == 'open' or selected_columns_df['SR Status'].str.lower == 're-open':
selected_columns_df['Open Resolve Duration'] = selected_columns_df.apply(lambda row:open_duration(calculate_totduration(row['SR Creation Time'],pd.to_datetime('today'))),axis=1)
else:
print('inside if and in else')
print(selected_columns_df['SR Number'])
selected_columns_df['Open Resolve Duration'] = selected_columns_df.apply(lambda row :res_duration(row['Total Minutes']),axis=1)
My dataset column is changed to string using astype(str) and the column [‘SR Status’] contains the string “open” and “re-open” but while matching with IF statement it is always returing FALSE. Need help
New contributor
Jaffer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.