<jupyter_start><jupyter_text>If you want to run the solution checker, and you have never installed the grader package, uncomment and run the cell below. (It won't hurt to run if you have installed before.)<jupyter_code>#! pip install otter-grader
import pandas as pd
import numpy as np
import seaborn as sns<jupyter_output><empty_output><jupyter_text>Take note that **passing the grader checks does not mean that your answer is correct!** The grader performs some tests to catch significant problems, but does not validate against the true solutions.  Enter the matrix **1.** Create a vector of the first 8 prime numbers.<jupyter_code>primes = ...
grader.check("vector-primes")<jupyter_output><empty_output><jupyter_text>**2.** Create the vector [1, 4, 9, 16, …, 1521, 1600].<jupyter_code>squares = ...
grader.check("vector-squares")<jupyter_output><empty_output><jupyter_text>**3.** Create a matrix with 4 rows and 2 columns, with all entries equal to 2.5.<jupyter_code>C = ...
grader.check("matrix-constant")<jupyter_output><empty_output><jupyter_text>**4.** Write a function that accepts a matrix as input and returns the matrix that results from subtracting within every column the maximum value in that column.<jupyter_code>def subtract_max(A):
    ...
grader.check("matrix-subtract")<jupyter_output><empty_output><jupyter_text>School daze **1.** Create a series called `schools`, that has series name `"School"` and the values `"Delaware"`, `"Penn"`, `"Drexel"`, and `"Villanova"`.<jupyter_code>schools = ...
grader.check("school-series")<jupyter_output><empty_output><jupyter_text>**2.** Make a data frame called `uni` that looks like this:![data frame](df_snapshot.png)Note: The years should be of `int64` data type.<jupyter_code>uni = ...
grader.check("school-df")<jupyter_output><empty_output><jupyter_text>Fight, fight, fight! **1.** Load the `fight-songs.csv` file as a data frame called `songs`. Display the first 5 rows.<jupyter_code>songs = ...
...<jupyter_output><empty_output><jupyter_text>**2.** Select the *song_name* column and assign it to a variable called `names`. Define a series called `subset` having the 10th through 18th values of `names`.<jupyter_code>names = ...
subset = ...
grader.check("fight-names")<jupyter_output><empty_output><jupyter_text>**3.** What is the maximum value in the *trope_count* column?<jupyter_code>max_tropes = ...<jupyter_output><empty_output><jupyter_text>**4.** Select from `songs` only the rows having an index value divisible by 10, and only the columns *year* and *official_song*.<jupyter_code>selection = ...
grader.check("fight-select")<jupyter_output><empty_output><jupyter_text>**5.** Create a series showing the number of rows in `songs` belonging to each conference.<jupyter_code>num_conf = ...
grader.check("fight-numconf")<jupyter_output><empty_output><jupyter_text>**6.** Make a data frame selecting all the songs written in 1915.<jupyter_code>songs1915 = ...
grader.check("fight-1915")<jupyter_output><empty_output><jupyter_text>**7.** How many of the fight songs last less than one minute?<jupyter_code>num_short = ...<jupyter_output><empty_output><jupyter_text>**8.** Plot the distribution of *sec_duration* as a histogram over 12 bins.<jupyter_code>...<jupyter_output><empty_output><jupyter_text>**9.** Plot histograms of *bpm*, separated into columns by the value of *student_writer*.<jupyter_code>...<jupyter_output><empty_output><jupyter_text>**10.** Make a violin plot showing the distribution of *bpm* for each *conference*.<jupyter_code>...<jupyter_output><empty_output><jupyter_text>**11.** Create a new data frame that replaces in `songs` all instances of `"Yes"` with `True` and all instances of `"No"` with `False`.<jupyter_code>songsTF = ...
grader.check("fight-replace")<jupyter_output><empty_output><jupyter_text>---To double-check your work, the cell below will rerun all of the autograder tests.<jupyter_code>grader.check_all()<jupyter_output><empty_output><jupyter_text>SubmissionMake sure you have run all cells in your notebook in order before running the cell below, so that all images/graphs appear in the output. The cell below will generate a zip file for you to submit.Select *Kernel/Restart & Run All*, then save, then run this export cell again. Submit by pushing the resulting zip file to your GitHub assignment repo.<jupyter_code>grader.export(pdf=False, force_save=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.125426039536469, 'fraction_numerical': 0.013633265167007498, 'mean_word_length': 6.312292358803987, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '20', 'dir': 'jupyter-structured-clean-dedup', 'id': '579837', 'license': 'MIT', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1420, 'n_words': 435, 'path': 'basics/basics.ipynb', 'repo_name': 'UD-Math-Data-Science-1/labs', 'size': '4401'}