2

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
  • 49
  • 2
  • 7

1 Answers1

6

This should do the trick:

kj[(kj['End Terminal'] == 10) & (kj['Duration']>70)]
cs95
  • 330,695
  • 80
  • 606
  • 657
gold_cy
  • 12,080
  • 3
  • 20
  • 42
  • I removed the typo,and this worked : kj[(kj['End Terminal'] == 10) & (kj['Duration']>70)] – Alen Jul 10 '17 at 11:45