I get that you want to use two functions to update the value, but as others have already provided great answers, I am showing an alternative way on how you can use one function to get the flexibility.
CSV file
data.csv
col1,col2
foo1,foo2
bar1,bar2
foobar1,foobar2
Code
import pandas as pd
df = pd.read_csv('data.csv')
def func(rows, col, elem):
global df
if isinstance(col, str): # check if column name is passed
df.iloc[rows, df.columns.get_loc(col)] = elem
else: # check if column index is passed
df.iloc[rows, col] = elem
func([0,2], 'col1', 'test1') # you can specify column by name, or
func(1, 1, 'test2') # specify column by index
df.to_csv('data.csv', index = False)
print(df)
# col1 col2
# 0 test1 foo2
# 1 bar1 test2
# 2 test1 foobar2
Advantage is that, you can update multiple rows at a time, and can use either index or name to specify columns.
Note only that, if you want to update multiple rows, with different values, you can do that too:
print(df)
# col1 col2
# 0 test1 foo2
# 1 bar1 test2
# 2 test1 foobar2
func([0,2], 'col1', ['new_test1', 'new_test2'])
print(df)
# col1 col2
# 0 new_test1 foo2
# 1 bar1 test2
# 2 new_test2 foobar2