0

Hi could anyone help me out? I'm trying to group the IDs and have a counter for the number of "t" found in a column for each ID.

f1 = df3[df3['listing_id'].value_counts().reset_index().str.contains('t')]
count = f1['available'].value_counts().reset_index()
print(count)
print(f1)

Data file

An example output would be:

   ID   Number of t
14250             1 
12351            10
...

Thanks

mozway
  • 194,879
  • 13
  • 39
  • 75

0 Answers0