here are snippets of my codes
sol = []
df = pd.DataFrame({
'Emp' : ['A1', 'AA12', 'AA132', 'BBB142', 'BB152', 'B132','A221', 'AAA652', 'AA4542', 'BBB1233', 'BB121', 'B1213'],
'val' : [4560.0, 64.0, 456.0, 34.0, 534.0, 54.0,4560.0, 64.0, 456.0, 34.0, 534.0, 54.0]
}).set_index('Emp')
df2 = pd.DataFrame([2,3,2,3,4,5,6,7,8,5,7,12],columns=['vv'])
for x in range(10):
sol.append(df.mul(df2.values)['val'].to_list())
what I want to do is change the value of df['B1213'] to 1111 in the code
sol.append(df.mul(df2.values)['val'].to_list())
without creating a new dataframe
I tried to convert df to dictionary and use update() function to change the value and change it back to a df. Didnt work and looked quite convoluted. Is there an easier way to do it?