Question: I need help creating a function that tells me if a column is numeric or non-numeric. If it's numeric then that entire column will saved

I need help creating a function that tells me if a column is numeric or non-numeric. If it's numeric then that entire column will saved into a new data frame called num_data. I just can't figure out how I can check the entire entries of the column? I know is.numeric will let me know if something is numeric but can this be used to check the entire entries in column. Below is dummy dataset I made and every column should be stored into the new dataset num_data except column G.

def categories(data): ''' This function categorizes will tell me if each column is numeric or nonnumeric. If it's numeric then it will be stored into a new dataframe called num_data' Arguments: - data: Pandas DataFrame with input data Returns: - num_data: Pandas DataFrame containing only the numeric data fields''' pass

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!