0

screenshot of code I need to work

Does anybody know how I can change my code so that it only displays values of 1 or 0 for each row in my dataframe for biasA and biasB (shown in the screenshot) - by this I mean no values of 0 and 0 for biasA and biasB. I have attempted to do this on the df1 line, and I have searched online and have not found anything. If anyone could let me know ASAP it would be great.

jonnb104
  • 119
  • 1
  • 6
  • Please post code and any errors as text, not image. – ewokx Aug 06 '20 at 23:55
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Aug 08 '20 at 17:56

1 Answers1

2

Can use

df[(df.biasA==1)|(df.biasB==1)]

or

df[(df.biasA.eq(1))|(df.biasB.eq(1))]
wwnde
  • 26,119
  • 6
  • 18
  • 32