Pandas Count Occurrences in Column – i.e. Unique Values
In this Pandas tutorial, you will learn how to count occurrences in column using the value_counts() method.
Pandas Count Occurrences in Column – i.e. Unique Values Read More »
In this category you will find posts that are related to programming and should be interesting for psychologists, cognitive scientists, and neuroscientists. Well, almost every researcher would probably find some of the information useful at some time!
Every research psychologist, cognitive scientist, and neuroscientist, should know how to program.. Knowing how to program and write scripts will make many of a researchers everyday tasks much easier. For instance, instead of going through line after line of raw data you can write a Python script that runs through each cell in each column. Furthermore, you get the possibility to use more advanced, and cutting edge, statistical techniques by using R statistical programming environment.
Another example might be to create experiments using PsychoPy (either by coding using Python or using the drag-and-drop interface) and the cheap and open-source Arduino microcontroller. Also, coding is fun and relaxing!
In this Pandas tutorial, you will learn how to count occurrences in column using the value_counts() method.
Pandas Count Occurrences in Column – i.e. Unique Values Read More »
In this post, you will learn how to generate sequences of numbers in R using the : operator, the seq() and rep() functions.
How to Generate a Sequence of Numbers in R with :, seq() and rep() Read More »
In this short NumPy tutorial, you will learn how to convert a float array to an integer array in Python.
How to Convert a Float Array to an Integer Array in Python with NumPy Read More »
In this post, you will learn how to carry out the non-parametric test known as Mann-Whitney U test with Python. Specifically, you will learn how to carry out this test with SciPy and Pingouin.
How to Perform Mann-Whitney U Test in Python with Scipy and Pingouin Read More »
In this post, you will learn how to install specific packages with pip.
Pip Install Specific Version of a Python Package: 2 Steps Read More »
In Pandas, you can convert a column (string/object or integer type) to datetime using the to_datetime() and astype() methods. Furthermore, you can also specify the data type (e.g., datetime) when reading your data from an external source, such as CSV or Excel. In this Pandas tutorial, we will learn how to convert a column, containing
Pandas Convert Column to datetime – object/string, integer, CSV & Excel Read More »
In this post, you will learn how to convert a NumPy array to a Pandas dataframe. To be specific, you will learn about the syntax of the DataFrame class, how to use the most important parameters to set the column names among other things.
How to Convert a NumPy Array to Pandas Dataframe: 3 Examples Read More »
In this short Pandas tutorial, you will learn how to make column index in a dataframe. Standardly, when creating a dataframe, whether from a dictionary or by reading a file (e.g., reading a CSV file, or opening an Excel file) an index column is created. For this reason, we need to either set the specific
How to Make a Column Index in Pandas Dataframe – with Examples Read More »
Here are two simple steps to extract year from date in R. If you read the full post you will find out how to get year from date from also a vector, and a dataframe.
How to Extract Year from Date in R with Examples Read More »
In this post, you will learn how to: 1) add an empty column using base R and tibble (i.e., add_column()); 2) add multiple columns.
How to Add an Empty Column to a Dataframe in R (with tibble) Read More »