<jupyter_start><jupyter_text>Lecture 14 – File Formats and Modules Data 94, Spring 2021  Review: dictionaries<jupyter_code>{'name': 'Junior', 
 'age': 11, 
 'color': 'brown'}
tracks = {
    'Drake': ['Best I <NAME>ad', "Marvin's Room", 'One Dance', 'Controlla'],
    '<NAME>': ['Just Dance', 'Paparazzi'],
    'DaBaby': ['Rockstar', 'Suge'],
    '<NAME>': ["Driver's License"]
}
tracks['<NAME>']
tracks['Drake'].append('One Dance')
tracks['Maroon 5'] = ['Wake Up Call', 'Payphone']
tracks<jupyter_output><empty_output><jupyter_text>Quick Check 1<jupyter_code>tracks = {
    'Drake': ['Best I Ever Had', "Marvin's Room", 'One Dance', 'Controlla'],
    '<NAME>': ['Just Dance', 'Paparazzi'],
    'DaBaby': ['Rockstar', 'Suge'],
    '<NAME>': ["Driver's License"]
}<jupyter_output><empty_output><jupyter_text>Data formats<jupyter_code>grandma_tree = {
    "name": "Grandma",
    "children": [
        {"name": "Dad",
         "children": [
            {"name": "Me"},
            {"name": "Brother"}
             ]
            },
        {"name": "<NAME>",
         "children": [
            {"name": "<NAME>"},
            {"name": "<NAME>",
             "children": [
                 {"name": "Cousin 2 Jr."}
                 ]
              }
            ]
        }
    ]
}<jupyter_output><empty_output><jupyter_text>Modules<jupyter_code>np.pi
import numpy as np
np.pi
pi
np.array([1, 2, 3]) + np.array([4, 5, -3])
Table.read_table('data/pups.csv')
from datascience import *
pups = Table.read_table('data/pups.csv')
pups
Table.read_table('covid.csv')
import json
def read_json(path):
    return json.load(open(path, 'r'))
read_json('data/family.json')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20261437908496732, 'fraction_numerical': 0.0112893642305407, 'mean_word_length': 3.1683168316831685, 'pattern_counts': {'":': 12, '<': 26, '<?xml version=': 0, '>': 26, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '618234', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 641, 'n_tokens_neox': 605, 'n_words': 123, 'path': 'lecture/lec14/lec14.ipynb', 'repo_name': 'surajrampure/data-94-sp21', 'size': '1713'}