Created
January 27, 2016 02:20
-
-
Save ryantuck/66e65323103f91b5ac80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
data = [ | |
[1,2], | |
[3,4], | |
[4,5], | |
[8,9] | |
] | |
df = pd.DataFrame(data, columns=['a','b']) | |
print df | |
def my_fn(x): | |
return 2*x | |
print '-------' | |
df['b'] = df['b'].apply(my_fn) | |
print df |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment