I have a pandas dataframe that shows a mixture of categorical contextual data for users, along with a bunch of numeric data (roughly 20 numerical columns in total) that is aggregated to give one row for one user. An example with reduced numerical columns:
userId country status numericColumn1 numericColumn2 numericColumn3
-------- --------- -------- ---------------- ---------------- ----------------
322 UK free 0 0 1.4
229 US free 0 0 0
346 HK paying 45 6 27.7
935 US free 0 0 0
What I would like to do is only get the rows where all numeric columns have values of 0s. i.e.
userId country status numericColumn1 numericColumn2 numericColumn3
-------- --------- -------- ---------------- ---------------- ----------------
229 US free 0 0 0
935 US free 0 0 0
The only way I could think of is by doing a pd.query where each of the numeric columns are 0: df.query('numericColumn1 == 0 & numericColumn2 == & numericColumn3 ==0) but this wouldn't work for when you have the multiple numerical columns(20) like I have.
Is there a better way? or can I only do this by chaining multiple query conditions together.