Exercise: Data Typing and Structuring
Practice converting the data types and structuring them with examples.
Data typing
Suppose we extracted a dataset that includes a field called Price
that represents the price of a product in dollars. However, upon further inspection, we noticed that the column’s data type is a string instead of a float. Furthermore, the prices are formatted with a dollar sign and comma, such as '$1,000.00'
.
We know the data should eventually be loaded into a database table with a column data type of float. Our task is to remove the dollar sign and commas from the ...