I have a file like this:
I have requirement like if the column name 'names' contains '%' the data in 'val' column should be multiplied by 100. Below is the logic I am trying
import pandas as pd
df = pd.read_csv("pp_sample.csv")
saved_columns=df['names']
if "%Diff" in saved_columns:
value=df['val']*100
print(value)
else:
print("no values")
When I run this I am getting 'no values' as result, Since I am very new to Python please help me on this.