3

Table I am working with

This is the Table I am working with

I need to access the data points with 'Duration'>70 and 'End Terminal'==10 Hence I tried

kj[kj['Duration']>70] 
kj[kj['End Terminal'] == 10]

above commands are working fine separately but when I club them as:

kj[kj['End Terminal'] == 10] & kj[kj['Duration']>70] 

there is an error, hence how to use both conditions in one statement in Pandas-Python

Alen
  • 59
  • 2
  • 7

1 Answers1

6

This should do the trick:

kj[(kj['End Terminal'] == 10) & (kj['Duration']>70)]
cs95
  • 379,657
  • 97
  • 704
  • 746
gold_cy
  • 13,648
  • 3
  • 23
  • 45
  • I removed the typo,and this worked : kj[(kj['End Terminal'] == 10) & (kj['Duration']>70)] – Alen Jul 10 '17 at 11:45