1

I would like to give the user of my program the ability to filter values in a column by a specific value of their choosing. However, my code turns up the following error "Invalid Type Comparison". Any ideas how to do this?

var2 = input("Enter Which Value you would like to filter by")
b = frame[(frame['Column1'] > var2)]
print(b)

1 Answer 1

1

Figured it out, easy solution. Had to convert the value to a float

b= frame[(frame['Column1'] > float(var2))]
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.