Press "Enter" to skip to content

Tag: Tutorial

Pandas Excel Tutorial: How to Read and Write Excel files

In this Pandas Excel tutorial, we will learn how to work with Excel files in Python. It will provide an overview of how to use Pandas to load xlsx files and write spreadsheets to Excel.

In the first section, we will go through, with examples, how to use Pandas read_excel to; read an Excel file, read specific columns from a spreadsheet, read multiple spreadsheets and combine them to one dataframe. Further more we are going to learn how to read many Excel files, and how to convert data according to specific datatypes (e.g., using Pandas dtypes).

Pandas Read Excel Tutorial - Example xlsx File
.xlsx file

When we have done this, we will continue by learning how to write Excel files; how to name the sheets and how to write to multiple sheets.

OpenSesame Tutorial – How to Create a Flanker Task

In this post you are going to learn how to create a simple experiment using the free experiment building software OpenSesame. As I have previously written about, OpenSesame, is an application, based on Python, for creating Psychology, Neuroscience, and Economics experiments. It offers a nice and easy to use interface.  In this interface you can drag-and-drop different objects. This means that you don’t have to know any Python programming at all to create an experiment. If you need to know how to use images as stimuli you can see this OpenSesame Tutorial.

How to create a psychology exeriment using OpenSesame

R from Python – an rpy2 tutorial

Rpy2 Tutorial: How to Run R in Python

In this post, we are going to answer the question can you run R in Python? Of course, the answer is yes!; using the Python package rpy2. This package offers a Python interface to R.

In this tutorial, we will learn how to use rpy2 to install r packages, and run r functions to carry out data analysis and data visualization. More specifically, we will learn how to sue the r packages r-packages ‘afex‘ and ‘emmeans‘,  usin Python, and rpy2.  Finally, we will also learn how to display R plots in Jupyter notebooks using rpy2, using two different methods.

Obviously; rpy2 requires that we have both R (version +3.2.x) and Python (versions 2.7 and 3.X) installed. There are pre-compiled binaries available for Linux and Windows (unsupported and unofficial, however).