Python

Python programming related stuff

In the posts in this category you will find Python scripts. Python is said to be one of the easiest programming language to learn. Learning one language will also make it easier to learn another, much more advanced, one. As a Bachelor student in the cognitive science programme I got to take Python courses. However, it was not before I started my Ph.D years that I realized how much use I had because I knew some programming.

For a psychology researcher Python might be ideal since it is relatively easy to learn and there is a huge Python community to get help from. How to build experiments using free and open-source tools such as PsychoPy, OpenSesame, Expyriment, and PyEPL is, for instance, something you could find in this category.

Pandas Tutorial: Renaming Columns in Pandas Dataframe

Renaming columns in Pandas can be a lifesaver when working with data. Sometimes, we might receive data from a colleague or download it from the internet, and the column names might not be informative or consistent with our analysis. This could lead to confusion and errors in data interpretation, so it’s essential to know how […]

Pandas Tutorial: Renaming Columns in Pandas Dataframe Read More »

reading xlsx files in python

Your Guide to Reading Excel (xlsx) Files in Python

Do you ever spend hours sifting through Excel files, trying to make sense of the data? Openpyxl can help! In this tutorial, we’ve covered everything you need to know about using Openpyxl in Python to read and manipulate Excel files. You will learn to import the necessary modules, set the file path, and read the file and its active sheet. We’ll also dive deeper into manipulating the sheet, including creating a dictionary from an Excel file and reading multiple Excel files in a directory.

By mastering these techniques, you can streamline your data processing workflow and gain valuable insights from your data in a fraction of the time. Whether you are a data analyst or someone looking to make sense of complex data sets, Openpyxl is a powerful tool to help you achieve your goals. So, grab your favorite beverage, fire up your Python IDE, and let’s get started!

Your Guide to Reading Excel (xlsx) Files in Python Read More »

get pandas column names

How to Get the Column Names from a Pandas Dataframe – Print and List

In this short post, you will learn 6 methods to get the column names from Pandas dataframe. One of the nice things about Pandas dataframes is that each column will have a name (i.e., the variables in the dataset). Now, we can use these names to access specific columns by name without having to know which column number it is.

How to Get the Column Names from a Pandas Dataframe – Print and List Read More »

Scroll to Top