Press "Enter" to skip to content

Month: December 2019

How to use Pandas get_dummies to Create Dummy Variables in Python

In this post, we will learn how to use Pandas get_dummies() method to create dummy variables in Python. Dummy variables (or binary/indicator variables) are often used in statistical analyses as well as in more simple descriptive statistics. Towards the end of the post, there’s a link to a Jupyter Notebook containing all Pandas get_dummies() examples.

Dummy Coding for Regression Analysis

One statistical analysis in which we may need to create dummy variables in regression analysis. In fact, regression analysis requires numerical variables and this means that when we, whether doing research or just analyzing data, wishes to include a categorical variable in a regression model, supplementary steps are required to make the results interpretable.

Creating dummy variables in Python get_dummies() Pandas

Learn How to Calculate Descriptive Statistics in R the Easy Way

In this post, we will learn how to carry out descriptive statistics in R. After we have learned how to do this, we will learn how to create a nice latex table and how to save the summary statistics to a .csv file.

Why Descriptive Statistics?

Carrying out descriptive statistics, also known as summary statistics, is a very good starting point for most statistical analyses. It is, furthermore, a very good way to summarize and communicate information about the data we have collected.

Descriptive statistics in R

Pipx: Installing, Uninstalling, & Upgrading Python Packages in Virtual Envs

In this post, we will learn how to use pipx. Specifically, we will learn how to use pipx to install Python packages. We will learn how to install pipx, use pipx to install packages, how to run Python packages from a temporary environment, how to uninstall packages, and upgrade packages using pipx.

How to Change the Size of Seaborn Plots

In this short tutorial, we will learn how to change the figure size of Seaborn plots. For many reasons, we may need to either increase the size or decrease the size, of our plots created with Seaborn.

How to Make Seaborn Plot Bigger

Now, if we only want to know how to increase the sie of a Seaborn plot we can use matplotlib and pyplot: e.g.;

import matplotlib.pyplot as plt
fig = plt.gcf()
fig.set_size_inches(12, 8)

Note, that we use the set_size_inches() method to make the Seaborn plot bigger.

When do We Need to Change the Size of a Plot?

One example, for instance, when we might want to change the size of a plot could be when we are going to communicate the results from our data analysis. In this case, we may compile the descriptive statistics, data visualization, and results from data analysis into a report, or manuscript for scientific publication.

FacetGrid Plot

Here, we may need to change the size so it fits the way we want to communicate our results. Note, for scientific publication (or printing, in general) we may want to also save the figures as high-resolution images.

Kubernetes Security: Logging Troubleshooting to Reduce the Likelihood of Being Hacked

Since the inception of the project, security for Kubernetes has come a long way. While this is true, it still contains a few “gotchas.” Beginning with the control plane, building up through the workload and network security, and completing with a projection into the future of security. While this is true, there are several tips to help fortify your clusters and increase overall resilience if they become compromised.

How to Read & Write SPSS Files in R Statistical Environment

In this post we are going to learn 1) how to read SPSS (.sav) files in R, and 2) how to write to SPSS (.sav) files using R.  More specifically, here we are going to work with the following two R packages haven (from the Tidyverse) and foreign to:

  • Read a .sav file into an R dataframe
  • Writing an R dataframe to a .sav file

Learn all About Installing & Updating Packages in Python

In this tutorial, we will learn the basics of installing, working and updating packages in Python. First, we will learn how to install Python packages, then how to use them, and finally, how to update Python packages when needed. More specifically, we are going to learn how to install and upgrade packages using pip, conda, and Anaconda Navigator.