Z Scores Python

Write a Python script to replace all review scores with their z scores, and based on these z scores, to drop all rows containing outliers. Specifically, you will need the following functionalities.Using any Python method/module/technique/data structure, save column 2 (containing reviewer names) and the header row of variable names from the .csv file of reviews, so that they can be brought back into a transformed matrix later.
As before, save columns 3 through 11 to an ndarray, replace all instances of ‘-1’ (denoting missing values) with NaN, and save the cleaned values to a different ndarray.
Mask the array of cleaned values, then replace all values with their columnar z scores, and next save these z scores in another new array called ‘z_array’.
Save ‘z_array’ to a .csv file called ‘z_array_csv.csv’, while bringing back in the saved column 2 and the saved header row. Use any Python method/module/technique/data structure to do so.
Copy ‘z_array_csv.csv’ to another csv file called ‘no_outliers_csv.csv’. Using any Python method/module/technique/data structure, delete all rows of reviews in ‘no_outliers_csv.csv’ that contain two or more outlier values. An outlier value is any value greater than +3 or less than -3.A suggested Structured English algorithm to complete this assignment is attached here. You are free to fully/partly adopt it or use your own algorithm.

×
New Download