logo Use SA10RAM to get 10%* Discount.
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Sina AntiqueePsychology
(5/5)

761 Answers

Hire Me
expert
Patricia GloverrStatistics
(5/5)

887 Answers

Hire Me
expert
Jack DawsonTechnical writing
(5/5)

632 Answers

Hire Me
expert
Gary BartonAccounting
(5/5)

608 Answers

Hire Me
Others
(5/5)

How many samples exists in the dataset? Use the len() function.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Introduction:

Python is capable of reading datasets from various files like xlsx, csv, json, etc.  The Python package that allows you to read these external dataset files is the Python Data Analysis Library, pandas.

You can import the panadas package as: 

 

For example, to read a file named data.cvs, you could use:

 

The .values will convert the dataframe type data into an array (ndarray). If the file has multiple columns, you will need to specify the desired column using: y = df[‘name of the column’].values

Note: Download the file data.csv from Canvas. Either place it in the same directory where your .py file exists, otherwise specify the full path to the file. Also be aware that Python is case-sensitive.

Problems:

1. Write a python program that reads the data.csv file and plots the y variable and perform the following tasks:

a. How many samples exists in the dataset? Use the len() function.

b. Find the mean of the dataset and display on the console.

c. Find the minimum of the dataset and display on the console.

d. Find the  maximum of the dataset and display on the console.

e. Find the variance of the dataset and display on the console.

f. Find the median of the dataset and display on the console.

g. Find the standard deviation of the dataset and display on the console.

2. Using the same dataset as problem 1, plot the first 500 samples of the dataset. Add an appropriate title, x-label, y-label, and legend to the plot. Make sure that the x axis shows the samples 1-500.

3. Using the same dataset as problem 1, plot the last 500 samples of the dataset. Add an appropriate title, x-label, y-label, and legend to the plot. Make sure that the x axis shows the samples 9500-10000.

4. Using the same dataset as problem 1, plot the histogram of all samples in the dataset. Add an appropriate title, x-label, y-label, and legend to the plot. Hint: You can use plt.hist().

5. Plot the following two lines on one graph for 100 samples of x between -2 and 2. 

 

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme

Get Free Quote!

437 Experts Online