 ## R: Add a Column to Dataframe Based on Other Columns with dplyr

In this R tutorial, you are going to learn how to add a column to a dataframe based on values in other columns. Specifically, you will learn to create a new column using the mutate() function from the package dplyr, along with some other useful functions. Finally, we... ## How to use %in% in R: 7 Example Uses of the Operator

In this tutorial, you will learn by examples how to use the %in% in R. Specifically, you will learn 7 different uses of this great operator. Outline Here’s the outline of this post, described a bit more detailed than the table of contents. First, we start out with a... ## How to Transpose a Dataframe or Matrix in R with the t() Function

In this brief tutorial, you will learn how to transpose a dataframe or a matrix in R statistical programming environment. Transposing rows and columns is a quite simple task if your data is 2-dimensional (e.g., a matrix or a dataframe). If you have a, for example,... ## Pandas Count Occurrences in Column – i.e. Unique Values

In this Pandas tutorial, you are going to learn how to count occurrences in a column. There are occasions in data science when you need to know how many times a given value occurs. This can happen when you, for example, have a limited set of possible values that you... ## How to Generate a Sequence of Numbers in R with :, seq() and rep()

In this R tutorial, you will learn how to generate sequences of numbers in R. There are many reasons why we would want to generate sequences of numbers. For example, we may want to generate sequences when plotting the axes of figures or simulating data.  Outline... ## How to Convert a Float Array to an Integer Array in Python with NumPy

In this short NumPy tutorial, we are going to learn how to convert a float array to an integer array in Python. Specifically, here we are going to learn by example how to carry out this rather simple conversion task. First, we are going to change the data type from...