Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Activity Components Understanding the Requirements: Your activity involves creating a Python program that facilitates a Command Line Interface Tool for Data Analysis. The program should

Activity Components
Understanding the Requirements:
Your activity involves creating a Python program that facilitates a Command Line Interface
Tool for Data Analysis.
The program should guide user with a step-by-step instruction, from choosing desired
CSV file for loading the data into the program, to preparing the data, analyzing the data
to the final visualization of the processed data.Designing and Implementing the Solution:
Design a modular solution that consists of functions to perform each stage of Data
Analysis. There are four stages of Data Analysis involved in this task:
Load Data;
Clean and prepare data;
Analyze data;
Visualize and present the data.
Each stage of Data Analysis will ask user to interact through Command Line and select in
which way data should be processed.
Implement a main function that presents all four stages to the user in a first place and
then, open initial stage - Load Data. Data should be loaded from the CSV file and print
loaded data.
During 'Load Data' stage, user is asked to provide absolute or relative path to the CSV file.
Program will print all the columns and ask the user to choose which one should be
processed. In case user chooses non-numerical column, program reports error and asks
user to choose numerical column again. After user chooses correct column, values of the
column will be saved in the array as a string. Program should provide feedback if data is
loaded correctly. After loading data, program should print the table and shift into Cleaning
and Preparing data stage.
In 'Cleaning and prepare data' stage, program should replace all empty values from
numerical column with the replacement value. Convert numerical values from the string
to numerical type and exchange empty values with user's selection. This stage will offer
user with submenu, to ask if replacement value for empty cells should be:
minimum value in the column
maximum value in the column
average value calculated from all the values in the column.
After completing the second stage, program should take user into the 'Analyze Data'
Stage. For the purpose of this program, analyzing will be considered sorting the data in
ascending or descending order. Use Insertion sort to sort the array. Program will offer
user with two options:
Ascending order
Descending order
Final stage, 'Visualize the data', will print out all of the values in sorted order by printing
the name of the column and one '*' character for each 5 units of the sorted value. Which
means if the value is between 4 and 0 it will print one '*' character, if value is between
10 and 5 it will print '**', if the values is between 11 and 15, it will print '***' and it will
follow the pattern until reaching value of 100. For the values of 100 and above program
will just print maximum of 20'*' characters.Implementation Requirements:
The Command Line Interface should provide clear instructions and options for interacting
with the user. Clearly present names of all four stages at the beginning of the program.
Create function to perform 'Load Data' stage, which asks user to enter the path to the
CSV file, checks if file exists and loads the data.
Develop the function to perform 'Clean and prepare data' stage that asks user to choose
the column he wants to clear and prepare, and if user selects non numerical columns
notify user that column must be numerical and ask user to repeat the choice, until
numerical column is selected. After that, ask user if minimum, maximum or the average
of the column should be used to replace empty values in selected column. Create
separate functions for each operation, finding minimum, maximum and average, and do
not use built-in Python functions for min, max, etc.
Implement separate function for 'Analyze Data' stage. Ask user to choose between
ascending or descending order. Create different, separate function for sorting, and use
Insertion sort algorithm in implementation.
Create function for 'Visualize the data' stage to print one ?'**' character for each 5 units of
numerical value for each cell in the selected column. print maximum of 20t* characters
if value exceeds 100. For this task, negative values will not be considered.
Code should be robust to incorrect usage and should not crash or break. It is important
to implement appropriate error handling mechanisms and do not allow user to crash the
program with invalid input.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions