Created
February 11, 2026 21:06
-
-
Save jtrive84/8bd9ed3d3a5f99d5917601b5e0c9c2a8 to your computer and use it in GitHub Desktop.
Filter DataFrame to match conditions specified in a dictionary
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
| inp = { | |
| "BLDGCLASS": "3", | |
| "OCCTYPE": "47", | |
| "NUMSTORIES": "1", | |
| "FLOORAREA": "2500", | |
| "YEARBUILT": "12/31/1985", | |
| "COASTAL_DIST_GRP": "5-25 miles", | |
| #"GU_AAL_RATE": 1.398584, | |
| "FIPSCD": "12071", | |
| "STATECODE": "FL", | |
| "BUILDING_TIV": 1000000, | |
| } | |
| f = fl_actuals.loc[(fl_actuals[list(inp)] == pd.Series(inp)).all(axis=1)] | |
| f.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment