Reputation: 27
i want count of number 6 occurred for each row .
so for e.g for x1: number 6 has been repeated for 2 times in column a3 and a6. so the count is 2 for x1.
Upvotes: 0
Views: 21
Reputation: 7510
If I understand you correctly, you can do this like this:
(df == 6).sum(axis=1)
Upvotes: 1