Skip to content

Instantly share code, notes, and snippets.

@perone
Created December 5, 2012 23:27
Show Gist options
  • Save perone/4220483 to your computer and use it in GitHub Desktop.
Save perone/4220483 to your computer and use it in GitHub Desktop.
pandas table
>>> frame = ps.read_table('alunos.txt', header=None, sep="\s*", index_col=0)
>>> frame.ix["Fulano"]
X1 8.3
X2 7.6
X3 9.5
X4 6.4
Name: Fulano
>>> frame.ix["Sicrano"]
X1 5.6
X2 8.9
X3 7.4
X4 7.5
Name: Sicrano
>>>
>>> frame
X1 X2 X3 X4
X0
Fulano 8.3 7.6 9.5 6.4
Sicrano 5.6 8.9 7.4 7.5
Beltrano 5.6 7.8 9.4 5.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment