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.

Python Scientific Notation & How to Suppress it in Pandas & NumPy

In Python, it is possible to print numbers in scientific notation using base functions and NumPy. Specifically, using three different methods, you will learn how to use Python to print large or small (i.e., floating point) numbers in scientific notation. In the final two sections, before concluding this post, you will also learn how to […]

Python Scientific Notation & How to Suppress it in Pandas & NumPy Read More »

How to Make a Violin plot in Python using Matplotlib and Seaborn

In this Python data visualization tutorial, we will learn how to create a violin plot in Python with Matplotlib and Seaborn. We can carry out several techniques for visualizing data (see the post 9 Data Visualization Techniques You Should Learn in Python for some examples). Violin plots combine both the box plot and the histogram.

How to Make a Violin plot in Python using Matplotlib and Seaborn Read More »

Bartlett's test and Levene's test in Python

Levene’s & Bartlett’s Test of Equality (Homogeneity) of Variance in Python

In this Python tutorial, you will learn how to 1) perform Bartlett’s Test, and 2) Levene’s Test. Both are tests that are testing the assumption of equal variances. Equality of variances (also known as homogeneity of variance, and homoscedasticity) in population samples is assumed in commonly used comparison of means tests, such as Student’s t-test

Levene’s & Bartlett’s Test of Equality (Homogeneity) of Variance in Python Read More »

pandas convert string to date

Pandas Convert Column to datetime – object/string, integer, CSV & Excel

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 »

Scroll to Top