Skip to content

Instantly share code, notes, and snippets.

@LalehT
LalehT / Assignment 3 - Building a Custom Visualization.txt
Last active August 24, 2018 15:15
Assignment 3 - Building a Custom Visualization
Assignment 3 - Building a Custom Visualization
In this assignment you must choose one of the options presented below and submit a visual as well as your source code for peer grading. The details of how you solve the assignment are up to you, although your assignment must use matplotlib so that your peers can evaluate your work. The options differ in challenge level, but there are no grades associated with the challenge level you chose. However, your peers will be asked to ensure you at least met a minimum quality for a given technique in order to pass. Implement the technique fully (or exceed it!) and you should be able to earn full grades for the assignment.
Ferreira, N., Fisher, D., & Konig, A. C. (2014, April). Sample-oriented task-driven visualizations: allowing users to make better, more confident decisions. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems (pp. 571-580). ACM. (video)
In this paper the authors describe the challenges users face when trying to mak
@LalehT
LalehT / Practice Assignment: Understanding Distributions Through Sampling
Created August 21, 2018 04:23
Applied Plotting, Charting & Data Representation in Python - W3
Practice Assignment: Understanding Distributions Through Sampling
This assignment is optional, and I encourage you to share your solutions with me and your peers in the discussion forums!
To complete this assignment, create a code cell that:
Creates a number of subplots using the pyplot subplots or matplotlib gridspec functionality.
Creates an animation, pulling between 100 and 1000 samples from each of the random variables (x1, x2, x3, x4) for each plot and plotting this as we did in the lecture on animation.
Bonus: Go above and beyond and "wow" your classmates (and me!) by looking into matplotlib widgets and adding a widget which allows for parameterization of the distributions behind the sampling animations.
Tips:
@LalehT
LalehT / Assignment 2 - Applied Plotting, Charting & Data Representation in Python
Last active January 20, 2022 12:31
Applied Plotting, Charting & Data Representation in Python - W2
Assignment 2
Before working on this assignment please read these instructions fully. In the submission area, you will notice that you can click the link to Preview the Grading for each step of the assignment. This is the criteria that will be used for peer grading. Please familiarize yourself with the criteria before beginning the assignment.
An NOAA dataset has been stored in the file data/C2A2_data/BinnedCsvs_d400/fb441e62df2d58994928907a91895ec62c2c42e6cd075c2700843b89.csv. The data for this assignment comes from a subset of The National Centers for Environmental Information (NCEI) Daily Global Historical Climatology Network (GHCN-Daily). The GHCN-Daily is comprised of daily climate records from thousands of land surface stations across the globe.
Each row in the assignment datafile corresponds to a single observation.
The following variables are provided to you:
id : station identification code
@LalehT
LalehT / Iran History
Last active May 25, 2018 11:47
Iran History
import pandas as pd
import numpy as np
#Generating Years we want to study
Persian_years = list(range(1161,1397))
y = str(len(Persian_years))
print(y + ' years history of Iran')
type(Persian_years[1])
#Generating the kings datastructures
@LalehT
LalehT / Assignment 4 - Hypothesis Testing
Last active January 9, 2023 05:19
Data Science in Python by University of Michigan- Assignment 4- Hypothesis Testing
import pandas as pd
import numpy as np
from scipy.stats import ttest_ind
Definitions:
A quarter is a specific three month period, Q1 is January through March, Q2 is April through June, Q3 is July through September, Q4 is October through December.
A recession is defined as starting with two consecutive quarters of GDP decline, and ending with two consecutive quarters of GDP growth.
A recession bottom is the quarter within a recession which had the lowest GDP.
A university town is a city which has a high percentage of university students compared to the total population of the city.
Assignment 3 - More Pandas
This assignment requires more individual learning then the last one did - you are encouraged to check out the pandas documentation to find functions or methods you might not have used yet, or ask questions on Stack Overflow and tag them as pandas and python related. And of course, the discussion forums are open for interaction with your peers and the course staff.
Question 1 (20%)
Load the energy data from the file Energy Indicators.xls, which is a list of indicators of energy supply and renewable electricity production from the United Nations for the year 2013, and should be put into a DataFrame with the variable name of energy.
Keep in mind that this is an Excel file, and not a comma separated values file. Also, make sure to exclude the footer and header information from the datafile. The first two columns are unneccessary, so you should get rid of them, and you should change the column labels so that the columns are:
['Country', 'Energy Supply', 'Energy Supply per Capita', '%
Assignment 2 - Pandas Introduction
Part 1
The following code loads the olympics dataset (olympics.csv), which was derrived from the Wikipedia entry on All Time Olympic Games Medals, and does some basic data cleaning.
The columns are organized as # of Summer games, Summer medals, # of Winter games, Winter medals, total # number of games, total # of medals. Use this dataset to answer the questions below.
import pandas as pd