In a pandas dataframe created like this:
import pandas as pd import numpy as np df = pd.DataFrame(np.random.randint(10, size=(6, 6)), colu
This seems way too easy so perhaps I'm doing something wrong.
df <- data.frame(c1=1:6, c2=2:7, c3=3:8, c4=4:9, c5=5:10, c6=6:11, row.names=c('r1', 'r2', 'r3', 'r4', 'r5', 'r6')) df[c('r1','r2'),c('c1','c2')] c1 c2 r1 1 2 r2 2 3