In this tutoriual, we will learn how to convert the row name or row index name in a Pandas dataframe to a column. We will use Pandas’ reset_index() function to convert the index with name to a column. Let us load Pandas. Let us create a small dataframe in Pandas with rown index names. Our […]
How to resize an image with PyTorch
In this post, we will learn how to resize an image using PyTorch. PyTorch offers a numerous useful functions to manipulate or transform images. With PyTorch’s reSize() function, we can resize images. We will see a simple example of resizing a single image using Pytorch’s torchvision v2. First, let us load Numpy and Matplotlib. Let […]
Fashion-MNIST data from PyTorch
In this short tutorial we will learn how to get access to Fashion-MNIST dataset. Fashion-MNIST is one of the image datasets useful for learning and training Deep Learning algorithms in action. PyTorch’s torchvision module makes it easy access Fashion-MNIST dataset. Fashion-MNIST dataset is from Zalando’s article images and it contains a training set of 60,000 […]
Pandas case_when() with multiple examples
The newest Pandas release Pandas 2.2.0 has one of the most useful functions case_when() available on a Pandas Series object. Often you might want to create a new variable from an existing variable using multiple conditions. For a simple binary condition we can use Pandas’ where() function. With the new case_when() function we can apply […]
An Introduction to Statistical Learning: with Applications in Python Is Here
An Introduction to Statistical Learning in R ISLR, one of the best books to learn statistical learning, has a cousin now, Statistical Learning in Python. An Introduction to Statistical Learning in Python by Gareth James, Daniela Witten, Trevor Hastie, Robert Tibshirani, and Jonathan Taylor has been out recently. And just like the ISL in R, […]