Apr-10-2018, 09:07 PM
I have a dataframe with a lot of columns with binary values.
![[Image: TeSfMEynRlxDB2p7iQJhGSCTEW4li2bQ_08up0z1...ixerQ=s170]](https://lh3.googleusercontent.com/TeSfMEynRlxDB2p7iQJhGSCTEW4li2bQ_08up0z1cDNyfA4UsQSDSrYDZ8xuEYUK6ixerQ=s170)
Is it possible to count the number of rows that satisfy a condition
ex: the number of rows for Col1 and Col2 that are both 1 is 2
similarly the number of rows for Col1 and Col2 that are 0 and 1 is 1
Is there an easy way to do this rather than looping all over the dataframe?
Is it possible to count the number of rows that satisfy a condition
ex: the number of rows for Col1 and Col2 that are both 1 is 2
similarly the number of rows for Col1 and Col2 that are 0 and 1 is 1
Is there an easy way to do this rather than looping all over the dataframe?