Created
May 6, 2015 09:52
-
-
Save debidatta/6d2f6ad1f9b47910e2ee to your computer and use it in GitHub Desktop.
Custom filtering and mapping in Pandas
This file contains hidden or 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
| # mapped_series = df['series'].map(lambda x: Value you want x to be mapped to] | |
| mapped_series = df['series'].map(lambda x: x**2) | |
| # filtered_df = df['series'].map(lambda x: True/False function] | |
| filtered_df = df[df['series'].map(lambda x: len(x)>3]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment