I have a column and i want to find the length which is between 10 and 100 (for ex)
len(data[ 10 < data['TAHSILAT_DEGISIM_DEGER'] <= 100] )
error is : The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Use Series.between
with sum
for count only True
values:
data['TAHSILAT_DEGISIM_DEGER'].between(10, 100, inclusive=False).sum()
Or your solution:
len(data[data['TAHSILAT_DEGISIM_DEGER'].between(10, 100, inclusive=False)])
use len() with series data type docs of len() function
data[ 10 < data['TAHSILAT_DEGISIM_DEGER'].str.len() <= 100]
or
data[(data['TAHSILAT_DEGISIM_DEGER'].str.len()) <= 100 & (data['TAHSILAT_DEGISIM_DEGER'].str.len())>10]