I hope you are all having a good day. I am currently teaching myself Python through an online MOOC. I have a question about the following line of code:
test=list() for num in sal['JobTitle']: if 'chief' in num.lower(): sum1=True else: sum1=False test.append(sum1) test2=pd.DataFrame(test) test2['sum1'].value_counts()I am trying to see the number of True and False responses through the value_counts method. However, I receive an error message stating "an integer is required." I am not looking for an entirely new way of obtaining this answer, rather, I am trying to figure out how to go about this method and obtain the solution. I really want to learn all the intricacies of Python.
Moderator: Please use code tags in the future, so code is easier to read.
- nilamo