Select Page

Get Help With Your Essay

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results."

For This or a Similar Paper Click To Order Now

 

We are going to use some of our knowledge of Pandas to write a simple filter Python script. I am not providing a template. You will need to write a script that contains the “__main__” section along with a single required function. You may also want to include a parse_args function which can be copied and modified from previous assignments.
Data: attached
Instruction:
Download the iris dataset and use pandas to load in the dataset into a pandas dataframe. Write a function named filter that will take an argument, species, which is the species of the iris plant. It will use this species name to filter the dataframe so that it will contain only observations pertaining to the species passed in. It should then use the describe method of dataframes to determine the descriptive statistics of each column. Your function should print this value to the terminal but it should also write the output to a text file. Name this file output.txt.
Your script should also take in user output via command line arguments. The first argument will be the path to your file. The second argument should be the species. You might run your script like this for example:
python3 hw3.py iris.csv “Iris-setosa”
Running your script as in the example should create a file named output.txt in the current working directory that may not have been there already. This file will contain the descriptive statistics for the observations of “Iris-setosa”.

Get Help With Your Essay

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results."

For This or a Similar Paper Click To Order Now