import pandas as pd data = pd.DataFrame({'A' : [1, 2, 3, 4], 'B' : [1,2,3,4]}) def test(data): data = data + 1 return data data = test(data)