Converting R code to Python code

In the linked JupyterNotebook .html file (see image below for a preview), I provide Python code that does almost everything that my previous post’s R code does. The linked .html file is based on converting raw data into analyses and visualizations presented in “Experiment 1” of the following publication: https://moralitylab.bc.edu/wp-content/uploads/2022/01/mcmanus2021final.pdf. For brevity, I chose to only transform R code into Python code for one dataset of Experiment 1, and I chose to only conduct a subset of the analyses covered in the original R code (i.e., t-tests, ANOVAs, and cross-sectional correlations).

In order to see the full .html file, you must download it as an .html and then open it in a web browser. This can be achieved by opening the above JupyterNotebook link, clicking on the three dots in the top right corner of the OSF page, and finally clicking “download.” Once it is downloaded and opened in a web browser, you will be able to navigate to any visualization or portion of analyses that you wish (see image below for a preview). The file is organized in a way that allows you to scroll through various subsets of visualizations and analyses in chronological order so you know exactly what you’re looking at throughout your entire exploration. You can even see the code used to generate each visualization and analysis.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: