Home > Python > Quizzes > Python Clean Data
Python Clean Data
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 0% Most missed: “An existing dataframe has unsorted yearly sales data. You would like to arrange …”

For Pluralsight Skill Assessments.

Python Clean Data
Time left 00:00
18 Questions

1. We have sales data within a dataframe that contain product labels, prices, and quantities. How could we better arrange this data so we can see what
products are selling the least
2. In Pandas, which keyword defines a missing value?
3. We have sales data within a dataframe that contain product labels, prices, and quantities. How could we better arrange this data so we can see what
products are selling the least
4. If you sort the row indexes in a dataframe, what sort of changes would be expected within that dataframe?
5. Which type of Python function can be used with regular expressions to extract numbers from a string?
6. After analyzing a dataset, you see that the bottom 20 rows in the DataFrame df contains invalid data. Which command will drop these rows?
7. What does the following line of code do?
myDataFrame.columns = map(str.upper, myDataFrame.columns)
8. You attempted to drop a column by executing the following command
python
dataf.drop('columnName', axis=0)
You received the following error. Why
ValueError: labels['columnName'] not contained in axis
9. You have a DataFrame df with the shape (4,3) with the following data:\r\n\r\npython\r\n\r\n

Sales| Realised Profit |Expected Profit

\r\n\r\n

||

\r\n\r\n

451210 |84012 |165813

\r\n\r\n

549845 |64205 |104877

\r\n\r\n

231384 |52209 |175926

\r\n\r\n

781206 |59121 |124561

\r\n\r\n

 

\r\n\r\n

Based on this data, what is the output of the following code

\r\n\r\n

python

\r\n\r\n

try:

\r\n\r\n

df.drop("Expected Profit", axis=1, inplace=True)

\r\n\r\n

print (df.shape)

\r\n\r\n

except:

\r\n\r\nprint(df.shape)\r\n
10. Which command will drop all rows in dataset 'df
11. When attempting to reindex a dataframe with a new index value not previously found in the original dataframe, what is the expected result?
12. In Pandas, which keyword defines a missing value?
13. If you sort the row indexes in a dataframe, what sort of changes would be expected within that dataframe?
14. After analyzing a dataset, you see that the bottom 20 rows in the DataFrame df contains invalid data. Which command will drop these rows?
15. You have been assigned the task of importing large amounts of CSV data (comma separated values) into your current application. All of the data
contains first and last names. How can you make sure the data will not conflict with the data currently residing in your application's dataframes
16. You have been assigned the task of importing large amounts of CSV data (comma separated values) into your current application. All of the data
contains first and last names. How can you make sure the data will not conflict with the data currently residing in your application's dataframes
17. You have a DataFrame df with the shape (4,3) with the following data:\r\n\r\npython\r\n\r\n

Sales| Realised Profit |Expected Profit

\r\n\r\n

||

\r\n\r\n

451210 |84012 |165813

\r\n\r\n

549845 |64205 |104877

\r\n\r\n

231384 |52209 |175926

\r\n\r\n

781206 |59121 |124561

\r\n\r\n

 

\r\n\r\n

Based on this data, what is the output of the following code

\r\n\r\n

python

\r\n\r\n

try:

\r\n\r\n

df.drop("Expected Profit", axis=1, inplace=True)

\r\n\r\n

print (df.shape)

\r\n\r\n

except:

\r\n\r\nprint(df.shape)\r\n
18. When attempting to reindex a dataframe with a new index value not previously found in the original dataframe, what is the expected result?