The query method in pandas DataFrames provides some flexibility in code, and potential speedups using numexpr.
Month: January 2021
Selecting in Pandas using where and mask
This is the fifth post in a series on indexing and selecting in pandas. If you are jumping in the middle and want to get caught up, here's what has been discussed so far: Basic indexing, selecting by label and locationSlicing in pandasSelecting by boolean indexingSelecting by callable Once the basics were covered in the … Continue reading Selecting in Pandas using where and mask
Indexing and Selecting in Pandas by Callable
In pandas, you can use callables where indexers are accepted. It turns out that can be handy for a pretty common use case.
Boolean Indexing in Pandas
This is the third post in the series on indexing and selecting data in pandas. If you haven't read the others yet, see the first post that covers the basics of selecting based on index or relative numerical indexing, and the second post, that talks about slicing. In this post, I'm going to talk about boolean … Continue reading Boolean Indexing in Pandas