I am trying to create a subset of data based on conditions of a certain column in the original data set. It works fine with only one condition (For example, data[TNT]<10000, but it doesn't work if I want to limit it within a range (data[TNT]>10000 and data[TNT]<25000.
#group2= 10k<TNT<25k
group2_b = data['TNT']>10000 and data['TNT']<=25000
group2 = data[group2_b]
The error message is:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().