Lab05_WriteUp

Question 1 Question 1a Suppose we wanted to build a histogram of our data to understand the distribution of literacy rates and income per capita individually. We can use countplot in seaborn to create bar charts from categorical data. 1 2 3 4 5 6 7 8 9 10 11 12 plt.figure(figsize=(15,5)) plt.subplot(1,2,1) sns.countplot(df['lit']) plt.xlabel("Adult literacy rate: Female: % ages 15 and older: 2005-14") plt.title('World Bank Female Adult Literacy Rate') plt.

Lab04_WriteUp

Question 1 dataset Question 1a Above, it seems like OFFENSE is more specific than CVLEGEND, e.g. “LARCENY” vs. “THEFT FELONY (OVER $950)”. If you’re unfamiliar with the term, “larceny” is a legal term for theft of personal property. To get a sense of how many subcategories there are for each OFFENSE, set calls_by_cvlegend_and_offense equal to a multi-indexed series where the data is first indexed on the CVLEGEND and then on the OFFENSE, and the data is equal to the number of offenses in the database that match the respective CVLEGEND and OFFENSE.

Lab03_WriteUp

Question 1 Question 1a For a DataFrame d, you can add a column with d['new column name'] = ... and assign a list or array of values to the column. Add a column of integers containing 1, 2, 3, and 4 called rank1 to the fruit_info table which expresses your personal preference about the taste ordering for each fruit (1 is tastiest; 4 is least tasty). Question 1b You can also add a column to d with d.

Count Complete Tree Nodes

222.Count Complete Tree Nodes Description Given the root of a complete binary tree, return the number of the nodes in the tree. According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible. It can have between 1 and $2^h$ nodes inclusive at the last level h. Design an algorithm that

Lab02_WriteUp

dataset Question 1 For this question we will use SQL to extract data out of the indiv_sample_nyc table. The schema for this table is given below. Question 1a Let’s start by looking at 2016 election contributions made by Donald Trump, who was a NY resident during that year. Write a SQL statement that will return the cmte_id, transaction_amt, and name for every contribution made by any donor with “DONALD” and “TRUMP” in their name.