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.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
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
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme