<jupyter_start><jupyter_text>Project McNulty Data VisualizationRead data file with flight and weather data and perform some data visualization.Most of the data visualization was performed in Tableau (not in this file).<jupyter_code>import pandas as pd
import matplotlib
import numpy as np
import matplotlib.pyplot as plt

import altair as alt<jupyter_output><empty_output><jupyter_text>Read Airline Data<jupyter_code># read data file
FlightData = pd.read_csv('data/FlightData.csv')
FlightData1 = pd.read_csv('data/FlightData_2016_2017.csv')
# Unique Airlines
print(FlightData['OP_UNIQUE_CARRIER'].value_counts())
print(FlightData1['OP_UNIQUE_CARRIER'].value_counts())
df2 = FlightData.groupby(['FL_DATE']).size()
print(df2.head())
print(df2.size)
plt.plot(range(365),df2);
# How may flights are on-time (0) and how many delayed (1){}
FlightData['Delay'].value_counts()
DelayCount = {}
OnTimeCount = {}
for index,row in FlightData.iterrows():
    date = row['FL_DATE']
    if row['Delay']:
        if date in DelayCount:
            DelayCount[date] += 1
        else:
            DelayCount[date] = 1
    else:
        if date in OnTimeCount:
            OnTimeCount[date] += 1
        else:
            OnTimeCount[date] = 1
plt.bar(DelayCount.keys(), DelayCount.values(), color='r');
plt.bar(OnTimeCount.keys(), OnTimeCount.values(), color='g');<jupyter_output><empty_output><jupyter_text>Altair Visualization<jupyter_code>alt.Chart(cars).mark_point().encode(
    x=,
    y='Miles_per_Gallon',
    color='Origin',
).interactive()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12812299807815503, 'fraction_numerical': 0.014734144778987828, 'mean_word_length': 4.93916349809886, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '402558', 'license': 'MIT', 'n_tokens_mistral': 554, 'n_tokens_neox': 530, 'n_words': 115, 'path': '3-McNulty_Project/McNulty_Visualize.ipynb', 'repo_name': 'Stitchmaker/Metis_Bootcamp', 'size': '1561'}