Jul-10-2020, 07:46 PM
why does this work
now for count and value counts
and
df[df['TotalPayBenefits']== df['TotalPayBenefits'].max()]but this gives an error
df[df['TotalPayBenefits'].max()]
Error:---------------------------------------------------------------------------
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
<ipython-input-24-d77051c168c8> in <module>
----> 1 df[df['TotalPayBenefits'].max()]
KeyError: 567595.43
while Key Error is kind of my answer but it doesnt give me the name it corresponds with the valuenow for count and value counts
df[df['AM or PM']=='AM'].value_counts()why does this give off an error
Error:AttributeError: 'DataFrame' object has no attribute 'value_counts'
while value_counts is definitely an attributeand
df['AM or PM'].value_counts()value counts work just fine here