<jupyter_start><jupyter_text>Flights to SQlite databaseUsing https://jhub.rc.ufl.edu we can only access /home, so make a symbolic link to the flights file on command line:```bashln -s /ufrc/zoo6927/share/Class_Files/data/flights.May2017-Apr2018.csv .```<jupyter_code># quick check that this worked

flights=open("/ufrc/zoo6927/share/Class_Files/data/flights.May2017-Apr2018.csv")

count=0
for Line in flights:
    count+=1
print(count)

flights.close()<jupyter_output>6156045<jupyter_text>Here's the metadata from the flights file: https://github.com/CompTools/Class_Files/blob/master/data/flights_metadata.md<jupyter_code>from sqlalchemy import create_engine
from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
from sqlalchemy import DateTime, Boolean

# Create a sqlite database 
engine = create_engine('sqlite:///zoo6927/flights.sqlite')

metadata=MetaData()
Airports = Table ('Airports', metadata,
                Column('ID', Integer, autoincrement=True),
                Column('Code', String, primary_key=True),
                Column('City', String),
                Column('State', String),
                Column('Name', String),
               )
Flights = Table ('Flights', metadata,
                 Column('Fl_date', DateTime),
                 Column('Origin', String, ForeignKey("Airports.Code")),
                 Column('Destination', String, ForeignKey("Airports.Code")),
                 Column('Dep_Time', String),
                 Column('Dep_Delay_New', Integer),
                 Column('Arr_Time', String),
                 Column('Arr_Delay_New', Integer),
                 Column('Cancelled', Boolean),
                 Column('Cancellation_code', String),
                )
                 
metadata.create_all(engine)
import csv
flights=open("/ufrc/zoo6927/share/Class_Files/data/flights.May2017-Apr2018.csv")

for Line in flights:
    reader = csv.DictReader(flights)
    ins=Airports.insert().values(Code=Line['ORIGIN'], Name=Line['ORIGIN_CITY_NAME]')

result = conn.execute(ins)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.125, 'fraction_numerical': 0.02374031007751938, 'mean_word_length': 3.1971544715447155, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 2, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '583167', 'license': 'MIT', 'n_tokens_mistral': 661, 'n_tokens_neox': 612, 'n_words': 124, 'path': 'JupyterNotebooks/Flights.ipynb', 'repo_name': 'CompTools/PS2-lepidopetera', 'size': '2064'}