crosstab output

Val Krem valkrem at
Fri Jan 6 18:26:32 EST 2017

Hi all,

How do I access the rows and columns of a data frame crosstab output?

Here is code using  a sample data and output.

a= pd.read_csv("cross.dat", skipinitialspace=True)


x1    0  1 
A1    3  2 
A2    1  4

I want to create a variable  by adding 2/(3+2) for the first row(A1)
and 4/(1+4) for the second row (A2)

Final data frame would be
A1 3 2  0.4
A2 1 4  0.8

Thank you in advance

More information about the Python-list mailing list