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 […]
Python Tips
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, […]
8 Plot types with Matplotlib in Python
Matplotlib, the most comprehensive visualisation library in Python for creating all kinds of plots of data visualization. However, it can also be a bit frustrating and daunting given so much you can do with Matplotlib. In this post, we will learn how to use 8 commonly used plot types, like scatter plot, histogram, with real […]