Sometimes, you may want to create sparse random matrices with specific shape and sparsity for testing out a new method or algorithm. Scipy’s sparse module has very useful functionalities that are of great use to create sparse matrices of specific density and from specific probability distributions. Let us see some simple examples of create random […]
How To Reorder a Boxplot in R? Hint: Use forcats
Sometimes, when one is making boxplot with ggplot2, one might like to order the boxes in a boxplot in a specific way. For example, one might want to sort the boxes in boxplot in ascending or descening order based on the mean or median values of groups in the boxplot. Reordering boxplots can reveal the […]
9 Ways To Create New Variables with tidyverse
When one wants to create a new variable in R using tidyverse, dplyr’s mutate verb is probably the easiest one that comes to mind that lets you create a new column or new variable easily on the fly. It is probably the go to command for every time one needed to make new variable for […]
4 Fantastic Data Science-y Books To Look Forward To
If you ask any practicing data scientist for recommendation for a good book to learn data science, you will get too many different useful books. Some may be introductory level, some may be introductory level with a bit of math not just coding, a bit advanced level, and some might be from different domains. It […]
How To Make Histogram in Python with Pandas and Seaborn?
Histograms are a great way to visualize the distributions of a single variable and it is one of the must for initial exploratory analysis with fewer variables. In Python, one can easily make histograms in many ways. Here we will see examples of making histogram with Pandas and Seaborn. Let us first load Pandas, pyplot […]