## Filtering DataFrames with the .query() Method in Pandas

Pandas provides a .query() method on DataFrame’s with a convenient string syntax for filtering DataFrames. This post describes the method and gives simple usage examples.

Pandas provides a .query() method on DataFrame’s with a convenient string syntax for filtering DataFrames. This post describes the method and gives simple usage examples.

It’s easy to linearly interpolate a 1-dimensional set of points in Python using the np.interp() function from NumPy.

You can create multi-dimensional coordinate arrays using the np.meshgrid() function, which is also available in PyTorch and TensorFlow. But watch out! PyTorch uses different indexing by default so the results might not be the same.

A step-by-step quick start guide for SageMaker Studio. Start a Studio session, launch a notebook on a GPU instance and run object detection inference with a detectron2 pre-trained model.

PyTorch has a one_hot() function for converting class indices to one-hot encoded targets.

The np.pad() function has a complex, powerful API. But basic usage is very simple and complex usage is achievable! This post shows you how to use NumPy pad and gives a couple examples.

You can use the top-level torch.softmax() function from PyTorch for your softmax activation needs.

When you absolutely have to iterate over rows in a Pandas DataFrame, use the .itertuples() method.

This post describes a trick for installing/upgrading Python packages in a Jupyter notebook. It’s useful for scratch code, but don’t do this when you need reproducible code.

The histplot() function in Seaborn is a great API for plotting histograms to visualize the distribution of your Pandas columns.

**Connect**

**Contact**

ben [at] sparrow [dot] dev

**Email List**