Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "cells": [
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "# Overview\n## Instuctions\n1. Create a .py file to record script for this exercise\n2. Read text carefully\n3. Copy and run pre-written code below, and finish the script shown as empty or incomplete code blocks in between<br>\n\n### Problem Statement\n\nThe team would like to do analysis on station/region performance data, currently available in CSD Server\nHowever, some data manipulation and aggregation are needed to prepare such a master table\nCreate master table to house data, and manually populate data that's missing in server\nMajor steps in this process include:\n0. (initialization)\n1. Pull data\n2. Create helpful variables\n3. Create a base table\n4. Clean up the server data, aggregation\n5. Insert everything into base table to get master data\n\n### Data information\n\n__sptf_raw__: data pulled from the server, contains historical performance data for each airport and selective parent regions\n\n note 1: each airport has four different levels of region - Subregion2, Subregion, Region and Region2, each row contains performance data for either an airport or a region, but not all regions are displayed.\n \n note 2: Actual and goal columns are calculated by dividing measure_ and goal_ numerator and denominator, and score is assigned based on bucketof gap to goal.\n \n note 3: All region-level data could be calculated by aggregating measure/goal numerators and denominators of subordinate airports/regions\n\n__AO_Structure__: complete region structure for each airport\n\n__metrics_info__: a glossary of performance metrics and relevant information"
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "# Let's get started!\n## 0. Initialzation\nChange directory using %cd C://... <br>\nImport the following packages<br>\n- _numpy_<br>\n- _pandas_<br>\n- _pyodbc_<br>\n- _product_ function from _itertools_ package<br>"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "## 1. Pull data"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "# Set configuration for SQL connection\nSQL_cnxn = pyodbc.connect('Trusted_Connection=yes', driver = '{SQL Server}',server = 'VCLD16GDACOSI01\\\\ACODEV01', database = 'Cust_Serv_Del')\n\n# Pull data by reading and executing local query files, using with ... as ... keyword to ensure files are properly closed after use\nwith open('Base table query.sql','r') as query:\n sptf_raw = pd.read_sql_query(query.read(),SQL_cnxn)",
- "execution_count": 3,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "__Note__<br>\nIt is a good practice to always open file using with...as..., which terminates connection to the file immediately\nafter the operation is complete and thus avoid unwanted result while saving memory space <br><br>\nNow, replicate the query above for AO structure.sql, save the table as AO_Structure"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "#close connection to database when done\nSQL_cnxn.close() ",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "## 2. Create helpful variables"
- },
- {
- "metadata": {
- "scrolled": true,
- "trusted": true
- },
- "cell_type": "code",
- "source": "prev_month = 5\ncurrent_month = 6\nprev_year = 2017\ncurrent_year = 2018",
- "execution_count": 8,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "use read_csv() from pandas package to load a table named metrics_info.csv, save as a variable called metrics_info, which is shown below"
- },
- {
- "metadata": {
- "trusted": true,
- "scrolled": true
- },
- "cell_type": "code",
- "source": "metrics_info.head(5)",
- "execution_count": 13,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "version_major": 2,
- "version_minor": 0,
- "model_id": "6c08c3d54a2e494c920b87a2f2c7c03b"
- }
- },
- "metadata": {}
- }
- ]
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "## 3. Create a base table"
- },
- {
- "metadata": {
- "scrolled": true,
- "trusted": true
- },
- "cell_type": "markdown",
- "source": "### Component 1/3: Year & Month combinations\nCreate a dataframe named *base_table_time* that contains all combination of current/previous years and months, then add a new column to the right named \"key\" where each row equals to 1<br>\nHint: use pandas.DataFrame(list(product(...),...), .......) plus other methods<br>\nYour result should look like this:\n"
- },
- {
- "metadata": {
- "trusted": true,
- "scrolled": true
- },
- "cell_type": "code",
- "source": "base_table_time.tail(8) # example of the last 8 rows of this table",
- "execution_count": 12,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "version_major": 2,
- "version_minor": 0,
- "model_id": "3361437415ab4613903731d7a761fbe2"
- }
- },
- "metadata": {}
- }
- ]
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "markdown",
- "source": "### Component 2/3: stations & regions\nThe following code block creates a table of all station and region names, along with flags "
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "base_table_stations = pd.concat([AO_Structure[['Station','Region2']].assign(Category = 'Line Station'),\n\t\t\t\t\t\t\t\t AO_Structure[['Subregion','Region2']].assign(Category = 'Subregion').rename(columns={'Subregion':'Station'}),\n\t\t\t\t\t\t\t\t AO_Structure[['Subregion2','Region2']].assign(Category = 'Subregion2').rename(columns={'Subregion2':'Station'}),\n\t\t\t\t\t\t\t\t AO_Structure[['Region','Region2']].assign(Category = 'Region').rename(columns={'Region':'Station'}),\n\t\t\t\t\t\t\t\t AO_Structure[['Region2']].assign(Category = 'Region2',Station = AO_Structure['Region2']),\n\t\t\t\t\t\t\t\t pd.DataFrame({'Station':'SYSTEM','Region2':'SYSTEM','Category':'SYSTEM'},index=[0])], ignore_index=True, sort=False)\\\n.drop_duplicates(subset='Station')\\\n.query('Station not in [\"UNK\",\"UNKNOWN\"]')\\\n.assign(key=1)\n\nbase_table_stations['Station'] = base_table_stations.apply(\n lambda x: 'INTERNATIONAL' if x.Station == 'INTERNATIONAL LINE STATIONS' else (\n 'DOMESTIC' if x.Station == 'DOMESTIC LINE AND REGIONAL STATIONS' else x.Station)\n ,axis=1)\nbase_table_stations['Category'] = base_table_stations.apply(\n lambda x: 'UNITED GROUND EXRPESS' if x.Station == 'UNITED GROUND EXPRESS' else (\n 'Hub' if x.Station in ['LAX','SFO','IAH','DEN','ORD','IAD','EWR'] else (\n x.Station if x.Station in ['DEN METRO','EWR METRO'] else x.Category))\n ,axis=1)",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "base_table_stations.head(5) # example",
- "execution_count": 14,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "version_major": 2,
- "version_minor": 0,
- "model_id": "73cd07aa03a5498e82357af5d39ac1af"
- }
- },
- "metadata": {}
- }
- ]
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "Now, replicate the last line of code in the above block to apply the following change<br><br>\nUpdate *Dom_Intl* column:<br>\nif station is either __SYSTEM__ or __UNITED GROUND EXPRESS__, use station name for Dom_Intl column<br>\nif station name is in one of the seven hubs, use \"Hub\" for Dom_Intl column<br>\nif Region2 is __INTERNATIONAL LINE STATIONS__, use \"International\", otherwise \"Domestic\""
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "### Component 3/3: data points\nCreate a single column dataframe called *base_table_measures* with column name \"variable\" and rows ['Actual','Goal','Score','MEASURE_NUM','MEASURE_DEN','GOAL_NUM','GOAL_DEN']<br>\nalso add another column named \"key\" where each row equals to 1"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "base_table_measures.head(3) # example",
- "execution_count": 16,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "version_major": 2,
- "version_minor": 0,
- "model_id": "4d537444fadf457396906a68e7ef6126"
- }
- },
- "metadata": {}
- }
- ]
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "### Stitch base table together\nCreate a table called base_table by joining all base table components together using .merge(table,on='column name'), specifically: <br>\n 1. base_table_time\n 2. *Metric_Name* and *Metric_Type* columsn from metrics_info Attn: you need to add a \"key\" column for join operation to be successful\n 3. base_table_statins Attn: please drop the *Region2* column before joining since it is no longer needed__\n 4. base_table_measures\nFinally, drop the *key* column which is used only for joining <br>"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "# Remove individual parts no longer used\n%reset_selective -f base_table_\n\nbase_table.head(5) # example",
- "execution_count": 17,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "version_major": 2,
- "version_minor": 0,
- "model_id": "c4b59c0dfbf047649233b834deed9215"
- }
- },
- "metadata": {}
- }
- ]
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "## 4. Clean up the server data, aggregation"
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "Complete the following tasks to clean the raw data (sptf_raw) and save as a new variable called sptf_cleaned\n1. drop rows where *Station* column is NaN, hint: __dropna()__\n2. since the metric names in server is different from final metric name used, we need to swap metric name by left joining *Metric_Name, Metric_Type and Name_in_Server* columns from metrics_info, and drop *Name in Server* column after use.\n3. remove additional rows if *Year, Month, Metric_Name, Station* columns are duplicated\n4. since the *Month* column has string datatype in server, we need to convert it to integer, hint: __astype()__\n5. database server also has all *Actual and Goal* columns in percentage numbers except for APU and MBR, we need to convert them to decimals, hint: __use apply() with a function similar to that in base_table_stations__\n6. create a new variable called sptf_cleaned_long (Good read: wide vs long data format), hint: __melt()__"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "# example of sptf_cleaned_long\nsptf_cleaned_long.head(8)",
- "execution_count": 18,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "version_major": 2,
- "version_minor": 0,
- "model_id": "afbbecf0fdbd4ca39190da39b0d9db3e"
- }
- },
- "metadata": {}
- }
- ]
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": 9,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "Now we would like to get data for all regions, which only exist partially in server. Start by preparing a table of only stations for aggregation as shown below<br>\nYou need to join sptf_cleaned with AO_Structure table, and drop *Actual, Goal and Score* columns<br><br>\nHint: to select only stations and not regions, use logical condition *Station*.str.len() == 3"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "temp_stations.head(5)",
- "execution_count": 19,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "version_major": 2,
- "version_minor": 0,
- "model_id": "76aac5f50c9246dbbee519e2524e389d"
- }
- },
- "metadata": {}
- }
- ]
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": 10,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "Then, use a for loop to aggregate the table at 4 different levels, i.e. Subregion, Subregion2, Region, Region2<br>\nComplete the following code block"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "# Create an empty variable to store aggregated tables from for loop\ntemp_aggr = []\n\n# For loop\nfor ? in ?:\n temp = x.groupby().aggregation()....\n temp_aggr.append(temp)\n \n# Convert the result from for loop into a dataframe\ntemp_aggr = pd.concat(temp_aggr)",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "Also do the following to aggregated table\n1. drop duplicates in *Year, Month, Metric_Name, Station* columns\n2. convert the table to long format\n3. If station name is 'INTERNATIONAL LINE STATIONS', change to INTERNATIONAL, same for DOMESTIC LINE AND REGIONAL STATIONS\n\n<br> Final table should look like:\n"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "temp_aggr.head(10)",
- "execution_count": 20,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "version_major": 2,
- "version_minor": 0,
- "model_id": "8e9a6135d0f04692aef91034930944a3"
- }
- },
- "metadata": {}
- }
- ]
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "## 5. Insert everything into base table to get master data\nAt this point, we have three major tables: __base_table__, __sptf_cleaned_long__ and __temp_aggr__, where __temp_aggr__ and __sptf_cleaned_long__ have overlaps but overall different data points<br>\nWe would like to merge them into the base table with the following steps\n1. left join __sptf_cleaned_long__ and __temp_aggr__ to __base_table__, only adding *value* column, store in a new variable called __data_long__\n2. Because aggregation returns 0 if there's nothing to aggregate, these values should be coerce to NaN<br>\nForce *value* column from __temp_aggr__ table to be NaN if: Metric_Type is either Safe or Efficient AND *Category* column of a station is not Line Station\n3. If *value* column from __sptf_cleaned_long__ table is NaN, replace with *value* column from __temp_aggr__ table\n4. Drop *value* column from __temp_aggr__ table, keep that of __sptf_cleaned_long__ table and rename column to *value*\n5. create a new data table named __data_wide__ that is the wide format version of __data_long__"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "",
- "execution_count": null,
- "outputs": []
- },
- {
- "metadata": {},
- "cell_type": "markdown",
- "source": "The final table should look like this"
- },
- {
- "metadata": {
- "trusted": true
- },
- "cell_type": "code",
- "source": "data_w.query('Year == 2018 and Month == 6 and Metric_Name == \"MBR\" and Station == \"SYSTEM\"')",
- "execution_count": 21,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "version_major": 2,
- "version_minor": 0,
- "model_id": "38f5966584804a17ad594d270568b105"
- }
- },
- "metadata": {}
- }
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3",
- "language": "python"
- },
- "language_info": {
- "name": "python",
- "version": "3.6.5",
- "mimetype": "text/x-python",
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "pygments_lexer": "ipython3",
- "nbconvert_exporter": "python",
- "file_extension": ".py"
- },
- "nbTranslate": {
- "hotkey": "alt-t",
- "sourceLang": "en",
- "targetLang": "fr",
- "displayLangs": [
- "*"
- ],
- "langInMainMenu": true,
- "useGoogleTranslate": true
- },
- "toc": {
- "nav_menu": {},
- "number_sections": false,
- "sideBar": false,
- "skip_h1_title": false,
- "base_numbering": 1,
- "title_cell": "Table of Contents",
- "title_sidebar": "Contents",
- "toc_cell": false,
- "toc_position": {},
- "toc_section_display": false,
- "toc_window_display": false
- },
- "varInspector": {
- "window_display": false,
- "cols": {
- "lenName": 16,
- "lenType": 16,
- "lenVar": 40
- },
- "kernels_config": {
- "python": {
- "library": "var_list.py",
- "delete_cmd_prefix": "del ",
- "delete_cmd_postfix": "",
- "varRefreshCmd": "print(var_dic_list())"
- },
- "r": {
- "library": "var_list.r",
- "delete_cmd_prefix": "rm(",
- "delete_cmd_postfix": ") ",
- "varRefreshCmd": "cat(var_dic_list()) "
- }
- },
- "types_to_exclude": [
- "module",
- "function",
- "builtin_function_or_method",
- "instance",
- "_Feature"
- ],
- "oldHeight": 236.4,
- "position": {
- "left": "1038px",
- "top": "76px",
- "width": "350px",
- "height": "258px",
- "right": "20px"
- },
- "varInspector_section_display": "block"
- },
- "widgets": {
- "application/vnd.jupyter.widget-state+json": {
- "version_major": 2,
- "version_minor": 0,
- "state": {
- "9a529850ecb84ff08bbf2ed16ceef2a2": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "5d7f8e2cc39648a68b369e0bfcbdbb79": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_9a529850ecb84ff08bbf2ed16ceef2a2",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- null,
- "Metric_Name",
- "Metric_Type",
- "Weight",
- "Name_in_Macro",
- "Name_in_Server",
- "Direction"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "hasIndex": "true",
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "integer",
- "string",
- "string",
- "double",
- "string",
- "string",
- "string"
- ],
- "values": [
- [
- "0",
- "Damages",
- "Safe",
- "0.1",
- "Damages",
- "Damages",
- "Negative"
- ],
- [
- "1",
- "LTI",
- "Safe",
- "0.075",
- "LTI",
- "LTI",
- "Negative"
- ],
- [
- "2",
- "OSHA",
- "Safe",
- "0.025",
- "OSHA",
- "OSHA",
- "Negative"
- ],
- [
- "3",
- "Airport BEAT",
- "Caring",
- "0.1",
- "Beat Score",
- "Beat",
- "Positive"
- ],
- [
- "4",
- "APU",
- "Caring",
- "0.05",
- "APU_BURN",
- "APU_BURN",
- "Negative"
- ],
- [
- "5",
- "PAX Door Variance",
- "Caring",
- "0.05",
- "PAX Door Variance",
- "Unmet",
- "Negative"
- ],
- [
- "6",
- "Misconnects",
- "Caring",
- "0.05",
- "MISCONNECTS",
- "Misconnects",
- "Negative"
- ],
- [
- "7",
- "Bags to claim U25",
- "Caring",
- "0.05",
- "ALL BAGS TO CLAIM U25",
- "Bags to claim",
- "Positive"
- ],
- [
- "8",
- "MBR",
- "Caring",
- "0.1",
- "MBR",
- "MBR",
- "Negative"
- ],
- [
- "9",
- "STAR D00",
- "Dependable",
- "0.1",
- "STAR D0-PCT",
- "STAR D00",
- "Positive"
- ],
- [
- "10",
- "D00",
- "Dependable",
- "0.1",
- "D0-PCT",
- "D00",
- "Positive"
- ],
- [
- "11",
- "AO Delays",
- "Dependable",
- "0.05",
- "AO DELAY PCT",
- "AO DELAYS",
- "Negative"
- ],
- [
- "12",
- "Quick Turn Success",
- "Dependable",
- "0.05",
- "MST SUCCESS PCT",
- "MST Success",
- "Positive"
- ],
- [
- "13",
- "CPEP",
- "Efficient",
- "0.075",
- "CPEP",
- "CPEP",
- "Negative"
- ],
- [
- "14",
- "ATW Productivity",
- "Efficient",
- "0.0125",
- "ATW",
- "ATW",
- "Negative"
- ],
- [
- "15",
- "BTW Productivity",
- "Efficient",
- "0.0125",
- "BTW",
- "BTW",
- "Negative"
- ],
- [
- "16",
- "Overall Score",
- "Overall Score",
- "1.0",
- "Overall Score",
- "Overall Score",
- "nan"
- ],
- [
- "17",
- "PULSE",
- "Safe - old",
- "nan",
- "PULSE",
- "AO PULSE",
- "Positive"
- ]
- ]
- }
- }
- },
- "c18f63503c3e4a82b357139e605057af": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "9a1258b6ff57477ca9a347817b57ca2d": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_c18f63503c3e4a82b357139e605057af",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- null,
- "Year",
- "Month",
- "key"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "hasIndex": "true",
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "integer",
- "integer",
- "integer",
- "integer"
- ],
- "values": [
- [
- "0",
- "2017",
- "1",
- "1"
- ],
- [
- "1",
- "2017",
- "2",
- "1"
- ],
- [
- "2",
- "2017",
- "3",
- "1"
- ],
- [
- "3",
- "2017",
- "4",
- "1"
- ],
- [
- "4",
- "2017",
- "5",
- "1"
- ],
- [
- "5",
- "2017",
- "6",
- "1"
- ],
- [
- "6",
- "2017",
- "7",
- "1"
- ],
- [
- "7",
- "2017",
- "8",
- "1"
- ],
- [
- "8",
- "2017",
- "9",
- "1"
- ],
- [
- "9",
- "2017",
- "10",
- "1"
- ],
- [
- "10",
- "2017",
- "11",
- "1"
- ],
- [
- "11",
- "2017",
- "12",
- "1"
- ],
- [
- "12",
- "2018",
- "1",
- "1"
- ],
- [
- "13",
- "2018",
- "2",
- "1"
- ],
- [
- "14",
- "2018",
- "3",
- "1"
- ],
- [
- "15",
- "2018",
- "4",
- "1"
- ],
- [
- "16",
- "2018",
- "5",
- "1"
- ],
- [
- "17",
- "2018",
- "6",
- "1"
- ]
- ]
- }
- }
- },
- "1ac3e23f693e4bd7be6beb61853e9354": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "3361437415ab4613903731d7a761fbe2": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_1ac3e23f693e4bd7be6beb61853e9354",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- null,
- "Year",
- "Month",
- "key"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "hasIndex": "true",
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "integer",
- "integer",
- "integer",
- "integer"
- ],
- "values": [
- [
- "10",
- "2017",
- "11",
- "1"
- ],
- [
- "11",
- "2017",
- "12",
- "1"
- ],
- [
- "12",
- "2018",
- "1",
- "1"
- ],
- [
- "13",
- "2018",
- "2",
- "1"
- ],
- [
- "14",
- "2018",
- "3",
- "1"
- ],
- [
- "15",
- "2018",
- "4",
- "1"
- ],
- [
- "16",
- "2018",
- "5",
- "1"
- ],
- [
- "17",
- "2018",
- "6",
- "1"
- ]
- ]
- }
- }
- },
- "9d8d8029e9b245a3844ab922b5a45b32": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "6c08c3d54a2e494c920b87a2f2c7c03b": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_9d8d8029e9b245a3844ab922b5a45b32",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- null,
- "Metric_Name",
- "Metric_Type",
- "Weight",
- "Name_in_Macro",
- "Name_in_Server",
- "Direction"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "hasIndex": "true",
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "integer",
- "string",
- "string",
- "double",
- "string",
- "string",
- "string"
- ],
- "values": [
- [
- "0",
- "Damages",
- "Safe",
- "0.1",
- "Damages",
- "Damages",
- "Negative"
- ],
- [
- "1",
- "LTI",
- "Safe",
- "0.075",
- "LTI",
- "LTI",
- "Negative"
- ],
- [
- "2",
- "OSHA",
- "Safe",
- "0.025",
- "OSHA",
- "OSHA",
- "Negative"
- ],
- [
- "3",
- "Airport BEAT",
- "Caring",
- "0.1",
- "Beat Score",
- "Beat",
- "Positive"
- ],
- [
- "4",
- "APU",
- "Caring",
- "0.05",
- "APU_BURN",
- "APU_BURN",
- "Negative"
- ]
- ]
- }
- }
- },
- "d846568e5dee4efab67ed7ac31868464": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "73cd07aa03a5498e82357af5d39ac1af": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_d846568e5dee4efab67ed7ac31868464",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- null,
- "Station",
- "Region2",
- "Category",
- "key",
- "Dom_Intl"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "hasIndex": "true",
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "integer",
- "string",
- "string",
- "string",
- "integer",
- "string"
- ],
- "values": [
- [
- "0",
- "BOG",
- "INTERNATIONAL LINE STATIONS",
- "Line Station",
- "1",
- "International"
- ],
- [
- "1",
- "AUS",
- "DOMESTIC LINE AND REGIONAL STATIONS",
- "Line Station",
- "1",
- "Domestic"
- ],
- [
- "2",
- "OGG",
- "DOMESTIC LINE AND REGIONAL STATIONS",
- "Line Station",
- "1",
- "Domestic"
- ],
- [
- "3",
- "BHM",
- "UNITED GROUND EXPRESS",
- "Line Station",
- "1",
- "Domestic"
- ],
- [
- "4",
- "ROC",
- "DOMESTIC LINE AND REGIONAL STATIONS",
- "Line Station",
- "1",
- "Domestic"
- ]
- ]
- }
- }
- },
- "b7e52f318f3f4a89beaf5dfaa10e2ae4": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "4d537444fadf457396906a68e7ef6126": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_b7e52f318f3f4a89beaf5dfaa10e2ae4",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- "variable",
- "key"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "string",
- "integer"
- ],
- "values": [
- [
- "Actual",
- "1"
- ],
- [
- "Goal",
- "1"
- ],
- [
- "Score",
- "1"
- ]
- ]
- }
- }
- },
- "f424372e752c476491f7ad57e2dc1791": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "c4b59c0dfbf047649233b834deed9215": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_f424372e752c476491f7ad57e2dc1791",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- null,
- "Year",
- "Month",
- "Metric_Name",
- "Metric_Type",
- "Station",
- "Category",
- "Dom_Intl",
- "variable"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "hasIndex": "true",
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "integer",
- "integer",
- "integer",
- "string",
- "string",
- "string",
- "string",
- "string",
- "string"
- ],
- "values": [
- [
- "0",
- "2017",
- "1",
- "Damages",
- "Safe",
- "BOG",
- "Line Station",
- "International",
- "Actual"
- ],
- [
- "1",
- "2017",
- "1",
- "Damages",
- "Safe",
- "BOG",
- "Line Station",
- "International",
- "Goal"
- ],
- [
- "2",
- "2017",
- "1",
- "Damages",
- "Safe",
- "BOG",
- "Line Station",
- "International",
- "Score"
- ],
- [
- "3",
- "2017",
- "1",
- "Damages",
- "Safe",
- "BOG",
- "Line Station",
- "International",
- "MEASURE_NUM"
- ],
- [
- "4",
- "2017",
- "1",
- "Damages",
- "Safe",
- "BOG",
- "Line Station",
- "International",
- "MEASURE_DEN"
- ]
- ]
- }
- }
- },
- "e9c9ddc30e71428a8097b3ce82bab502": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "afbbecf0fdbd4ca39190da39b0d9db3e": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_e9c9ddc30e71428a8097b3ce82bab502",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- "Year",
- "Month",
- "Metric_Name",
- "Metric_Type",
- "Station",
- "variable",
- "value"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "double",
- "integer",
- "string",
- "string",
- "string",
- "string",
- "double"
- ],
- "values": [
- [
- "2017.0",
- "1",
- "AO Delays",
- "Dependable",
- "AGU",
- "Actual",
- "5e-06"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "Dependable",
- "BZE",
- "Actual",
- "5e-06"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "Dependable",
- "CNY",
- "Actual",
- "nan"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "Dependable",
- "CVG",
- "Actual",
- "0.025005000000000003"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "Dependable",
- "LAX",
- "Actual",
- "0.12460400000000002"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "Dependable",
- "MFE",
- "Actual",
- "0.021701"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "Dependable",
- "PVD",
- "Actual",
- "0.006705"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "Dependable",
- "TPA",
- "Actual",
- "0.052102"
- ]
- ]
- }
- }
- },
- "ac1c0f3c72944845bc5f760da3cc4a26": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "76aac5f50c9246dbbee519e2524e389d": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_ac1c0f3c72944845bc5f760da3cc4a26",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- null,
- "Year",
- "Month",
- "Station",
- "MEASURE_NUM",
- "MEASURE_DEN",
- "GOAL_NUM",
- "GOAL_DEN",
- "Metric_Name",
- "Metric_Type",
- "Name_in_Server",
- "Subregion",
- "Subregion2",
- "Region",
- "Region2"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "hasIndex": "true",
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "integer",
- "double",
- "integer",
- "string",
- "double",
- "double",
- "double",
- "double",
- "string",
- "string",
- "string",
- "string",
- "string",
- "string",
- "string"
- ],
- "values": [
- [
- "0",
- "2017.0",
- "1",
- "AGU",
- "0.0",
- "31.0",
- "0.0",
- "961.0",
- "AO Delays",
- "Dependable",
- "AO DELAYS",
- "MEXICO",
- "THE AMERICAS",
- "THE AMERICAS",
- "INTERNATIONAL LINE STATIONS"
- ],
- [
- "1",
- "2017.0",
- "1",
- "BZE",
- "0.0",
- "89.0",
- "2.270069457",
- "2759.0",
- "AO Delays",
- "Dependable",
- "AO DELAYS",
- "CENTRAL AND SOUTH AMERICA",
- "THE AMERICAS",
- "THE AMERICAS",
- "INTERNATIONAL LINE STATIONS"
- ],
- [
- "2",
- "2017.0",
- "1",
- "CNY",
- "nan",
- "nan",
- "nan",
- "nan",
- "AO Delays",
- "Dependable",
- "AO DELAYS",
- "CHAFFEE",
- "REGIONAL - WEST",
- "REGIONAL LINE STATIONS",
- "DOMESTIC LINE AND REGIONAL STATIONS"
- ],
- [
- "3",
- "2017.0",
- "1",
- "CVG",
- "14.0",
- "561.0",
- "1020.885443872",
- "17453.0",
- "AO Delays",
- "Dependable",
- "AO DELAYS",
- "CLEVELAND UAX METRO",
- "LINE STATIONS - EAST",
- "DOMESTIC LINES EAST AND WEST",
- "DOMESTIC LINE AND REGIONAL STATIONS"
- ],
- [
- "4",
- "2017.0",
- "1",
- "LAX",
- "490.0",
- "3933.0",
- "15685.336245422",
- "121954.0",
- "AO Delays",
- "Dependable",
- "AO DELAYS",
- "LAX",
- "LAX",
- "LAX",
- "LAX"
- ]
- ]
- }
- }
- },
- "fb5679ff79ab4b2cbdf13165621059b9": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "8e9a6135d0f04692aef91034930944a3": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_fb5679ff79ab4b2cbdf13165621059b9",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- "Year",
- "Month",
- "Metric_Name",
- "Station",
- "variable",
- "value"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "double",
- "integer",
- "string",
- "string",
- "string",
- "double"
- ],
- "values": [
- [
- "2017.0",
- "1",
- "AO Delays",
- "ATLANTIC",
- "MEASURE_NUM",
- "129.0"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "DEN METRO",
- "MEASURE_NUM",
- "1460.0"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "EWR METRO",
- "MEASURE_NUM",
- "1360.0"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "IAD",
- "MEASURE_NUM",
- "394.0"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "IAH",
- "MEASURE_NUM",
- "1727.0"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "LAX",
- "MEASURE_NUM",
- "490.0"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "LINE STATIONS - EAST",
- "MEASURE_NUM",
- "829.0"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "LINE STATIONS - WEST",
- "MEASURE_NUM",
- "871.0"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "ORD",
- "MEASURE_NUM",
- "1592.0"
- ],
- [
- "2017.0",
- "1",
- "AO Delays",
- "PACIFIC",
- "MEASURE_NUM",
- "120.0"
- ]
- ]
- }
- }
- },
- "444c8f04bb874640b2efe65203ce32b6": {
- "model_name": "LayoutModel",
- "model_module": "@jupyter-widgets/base",
- "model_module_version": "*",
- "state": {
- "_model_module_version": "*",
- "_view_module_version": "*"
- }
- },
- "38f5966584804a17ad594d270568b105": {
- "model_name": "TableDisplayModel",
- "model_module": "beakerx",
- "model_module_version": "*",
- "state": {
- "layout": "IPY_MODEL_444c8f04bb874640b2efe65203ce32b6",
- "model": {
- "alignmentForColumn": {},
- "alignmentForType": {},
- "cellHighlighters": [],
- "columnNames": [
- null,
- "Year",
- "Month",
- "Metric_Name",
- "Metric_Type",
- "Station",
- "Category",
- "Dom_Intl",
- "variable",
- "value"
- ],
- "columnOrder": [],
- "columnsFrozen": {},
- "columnsFrozenRight": {},
- "columnsVisible": {},
- "contextMenuItems": [],
- "contextMenuTags": {},
- "fontColor": [],
- "hasDoubleClickAction": false,
- "hasIndex": "true",
- "headersVertical": false,
- "rendererForColumn": {},
- "rendererForType": {},
- "stringFormatForColumn": {},
- "stringFormatForType": {},
- "subtype": "ListOfMaps",
- "tooManyRows": false,
- "tooltips": [],
- "type": "TableDisplay",
- "types": [
- "integer",
- "integer",
- "integer",
- "string",
- "string",
- "string",
- "string",
- "string",
- "string",
- "double"
- ],
- "values": [
- [
- "901838",
- "2018",
- "6",
- "MBR",
- "Caring",
- "SYSTEM",
- "SYSTEM",
- "SYSTEM",
- "Actual",
- "4.4702"
- ],
- [
- "901839",
- "2018",
- "6",
- "MBR",
- "Caring",
- "SYSTEM",
- "SYSTEM",
- "SYSTEM",
- "Goal",
- "4.4702"
- ],
- [
- "901840",
- "2018",
- "6",
- "MBR",
- "Caring",
- "SYSTEM",
- "SYSTEM",
- "SYSTEM",
- "Score",
- "70.0"
- ],
- [
- "901841",
- "2018",
- "6",
- "MBR",
- "Caring",
- "SYSTEM",
- "SYSTEM",
- "SYSTEM",
- "MEASURE_NUM",
- "68289.0"
- ],
- [
- "901842",
- "2018",
- "6",
- "MBR",
- "Caring",
- "SYSTEM",
- "SYSTEM",
- "SYSTEM",
- "MEASURE_DEN",
- "15263702.0"
- ],
- [
- "901843",
- "2018",
- "6",
- "MBR",
- "Caring",
- "SYSTEM",
- "SYSTEM",
- "SYSTEM",
- "GOAL_NUM",
- "1939320.0"
- ],
- [
- "901844",
- "2018",
- "6",
- "MBR",
- "Caring",
- "SYSTEM",
- "SYSTEM",
- "SYSTEM",
- "GOAL_DEN",
- "457924080.0"
- ]
- ]
- }
- }
- }
- }
- }
- }
- },
- "nbformat": 4,
- "nbformat_minor": 2
- }
Add Comment
Please, Sign In to add comment