My dataframe looks like the below and name of the dataframe is "Assert_data"
System_Name Type
ABC Test-3451
BCS Dev-2323
ASD Dev-1213
FGS Prod-1212
ASC Tes-1244
Need help to replace the column value , If the Type column has a value as "Prod" , It should be replaced to "Production"
Likewise for Dev ==> Development & Tes ==> Test
I tired the following coding , But it throws "ValueError: either both or neither of x and y should be given"
df['Instance_type'] = np.where(Assert_data['Type'].str.contains("Prod"), "Production",
np.where(Assert_data['Type'].str.contains("Dev"), "Development",
np.where(Assert_data['Type'].str.contains("Tes"), "Test")))
Tried using pd.np.where - Same error message.