2021年3月13日星期六

Count frequency of values in a row?

I have a data frame set up as shown below (this is an example, the original is much larger):

enter image description here

I am trying to answer the question, "How many rows have three true values? Two true values? One true value?"

I would prefer to do it in SQL but I am struggling to find a solution. I am also struggling to find a solution in Pandas using Python. I would be open to either solution at this point.

If anyone has any pointers, I will be greatly appreciative. I'm sure it's a simple solution, I just haven't learned it yet and I can't find the correct way to do it.

https://stackoverflow.com/questions/66620897/count-frequency-of-values-in-a-row March 14, 2021 at 11:45AM

没有评论:

发表评论