Question: I am using Jupyter Notebook (Python). I have a data frame (The name of the dataframe is votes) and I need a function that changes

I am using Jupyter Notebook (Python). I have a data frame (The name of the dataframe is votes) and I need a function that changes all values into a number and converts things that aren't numbers into NaN. Things in the data frame are all numbers and no strings. Please help! I need to use for loop! Thankyou!! :)
It looks like someone wasn't very good at keeping track of things. And even worse, they liked to put some placeholder text where there should be values. This has made all of the types wrong.Correct all of the types so that we can do our analyses! The columns all contain numeric values. This means we don't have to convert them individually. We can loop through the columns and do it programatically! Finish my line of code so that it calls a Pandas (a) function that changes a value into a number and (b) converts things that aren't numbers into the NaN. for column name in votes.columns: votes[column name] " . YOUR ANSNER
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
