Skip to content

23 great pandas code

原文链接

Convert data frame to numpy array

df.as_matrix()

Apply a function to a data frame

This one will multiple all values in the “height” column of the data frame by 2

df["height"].apply(lambda height: 2 * height)