0

For each program, how many people have a Programming Skill knowledge of less than 4? Report one row for each existing program.

df1['ProgSkills'<4].groupby(by=df1['Program']).count()

Error message:

TypeError: '<' not supported between instances of 'str' and 'int'

Data frame:

Data frame

1 Answer 1

1
df1['ProgSkills'<4]

This literally compares the string ProgSkills to the number 4.

You meant to do

df1[df1['ProgSkills']<4]

Which will compare each value in the ProgSkills column to the number 4.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.