Question: Python function to clean a csv dataframe I would like to know how we can make an automatic function where as soon as we enter

Python function to clean a csv dataframe

I would like to know how we can make an automatic function where as soon as we enter the name of the column of the dataframe, it keeps only the numbers inside.

The function can be in a file . py, which I can transport and use directly in a file . ipynb

For example:

- There is a column price with have: "UK $887.00" or "US $999,000.99/kj" or "EUR 55,009.57/ea55,009.57/ea55,009.57/ea"

How a function can only keep the right price, without the comma. And if possible keep the currency in another column with only "UK", "US", etc...

- Or a column number of like : "1 like", or "54 like54like"

In this case, only keep the right number of like.

And this function can be used directly with other csv column

Python function to clean a csv dataframe I would like to know

price Like us $289.00 297like us $269.00 379like us $269.00/ea 431 like us $350.00 us $143.91 11 like 11 lik au $800.00 us $111.36 Olikeblike us $1,899.95us 5 like like

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!