I have a a dataframe with the following structure:
<class 'pandas.core.frame.DataFrame'>
Int64Index: 1152 entries, 0 to 143
Data columns:
cuepos 1152 non-null values
response 1152 non-null values
soa 1152 non-null values
targetpos 1152 non-null values
testorientation 1152 non-null values
dtypes: float64(3), int64(2)
The cuepos column and the targetpos column both contain integer values of either 1 or 2.
I would like to group this data by congruency between cuepos and targetpos. In other words, I would like to produce two groups, one for rows in which cuepos == targetpos and another group for which cuepos != targetpos.
I can’t seem to figure out how I might do this. I looked at using grouping functions, but these seem only to act on a single column… or am I mistaken? Can someone point me in the right direction?
Thanks in advance!
Blz
Note, if you goal is to do group computations, you can do
and the result will be keyed by True/False.