How can I use function with pandas dataframe. For example:
a | b london | uk newyork | usa berlin | germany df1 = df[[\'a\', \'b\']] def doSomething(df
df1 = df[['a', 'b']] def doSomething(df): df2 = df['a'] return df2 df3 = df1.apply(doSomething, axis=1) df3 = pd.DataFrame(df3).rename(columns={0: 'a'})