Created
June 9, 2015 04:38
-
-
Save wrobstory/500036b2544a1052dcf0 to your computer and use it in GitHub Desktop.
Pandas Loc
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
zero_to_ten = loans.loc[(loans['funded_amnt'] >= 0) & | |
(loans['funded_amnt'] < 10000)] | |
ten_to_twenty = loans.loc[(loans['funded_amnt'] >= 10000) & | |
(loans['funded_amnt'] <= 20000)] | |
ten_to_twenty = loans[loans['funded_amnt'] >= 200000] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Depends a bit on what you're doing afterwards. Do you need them as 3 separate series? I'd maybe use
And then do grouped operations from there. If you do need the 3 separate Series,
.query
looks cleaner to me: