Skip to content

Instantly share code, notes, and snippets.

View marsja's full-sized avatar

Erik marsja

View GitHub Profile

Keybase proof

I hereby claim:

  • I am marsja on github.
  • I am emarsja (https://keybase.io/emarsja) on keybase.
  • I have a public key ASBhVD0CZETpOwJyic4m3zQqhjW4ySkhGng2eXUY-VginAo

To claim this, I am signing this object:

@marsja
marsja / pandas_loc_example
Created October 10, 2019 07:12
This gist is for an example code found in the blog post on how to use loc and iloc https://www.marsja.se/how-to-use-iloc-and-loc-for-indexing-and-slicing-pandas-dataframes/
import pandas as pd
data = 'https://vincentarelbundock.github.io/Rdatasets/csv/DAAG/nasshead.csv'
df = pd.read_csv(data, index_col=1)
df.loc['case']
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marsja
marsja / data_processing.py
Last active March 23, 2023 07:23
The following scripts are the ones explained in the blog post on JEPS Bulletin: Python Programming in Psychology – From Data Collection to Analysis (http://blog.efpsa.org/2016/07/12/python-programming-in-psychology-from-data-collection-to-analysis/)
import os
from expyriment.misc import data_preprocessing
# Datafolder is where our data is stored. Lets create a string with the path
# to the folder. Note, this script needs to
# be run in the main folder of our flanker script
datafolder = os.getcwd() + os.sep + 'data'
# Imported data_preprocessing from expyriment.misc above makes it possible to
# get our data files (they start "flanker")