You can use vectorized operations in numpy to operate over entire arrays, then list unpack.
Also, remember that <- isn't a valid assingment in Python and the R people also finally decided to stop doing this too (it's only in legacy code or from legacy coders)
|
f_n_pp <- floor(twoByTwoContingencyTable[0]) #(floor in R/python --> largest integer value less than or equal to x) |
|
f_n_pm <- floor(twoByTwoContingencyTable[1]) |
|
f_n_mp <- floor(twoByTwoContingencyTable[2]) |
|
f_n_mm <- floor(twoByTwoContingencyTable[3]) |
f_n_pp, f_n_pm, f_n_mp, f_n_mm = np.floor(twoByTwoContingencyTable[0:4])
You can use vectorized operations in numpy to operate over entire arrays, then list unpack.
Also, remember that
<-isn't a valid assingment in Python and the R people also finally decided to stop doing this too (it's only in legacy code or from legacy coders)MEN2017/CausalR_Cubic1br.py
Lines 27 to 30 in 1f77631