{"id":1912,"date":"2023-08-09T02:18:09","date_gmt":"2023-08-09T09:18:09","guid":{"rendered":"https:\/\/gantovnik.com\/bio-tips\/?p=1912"},"modified":"2023-08-09T09:21:23","modified_gmt":"2023-08-09T16:21:23","slug":"372-tsa-data-number-of-passengers-at-usa-airport-checkpoints","status":"publish","type":"post","link":"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/372-tsa-data-number-of-passengers-at-usa-airport-checkpoints\/","title":{"rendered":"#372 TSA data: Number of passengers at USA airport checkpoints"},"content":{"rendered":"<p>Good news for the aerospace industry because the number of passengers passing through TSA checkpoints this year is the same as in 2019 (before COVID-19).<\/p>\n<p><a href=\"https:\/\/gantovnik.com\/bio-tips\/2023\/08\/372-tsa-data-number-of-passengers-at-usa-airport-checkpoints\/tsa_2023_08\/\" rel=\"attachment wp-att-1913\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/tsa_2023_08.png?resize=1080%2C553&#038;ssl=1\" alt=\"\" width=\"1080\" height=\"553\" class=\"alignnone size-full wp-image-1913\" srcset=\"https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/tsa_2023_08.png 1920w, https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/tsa_2023_08-1280x655.png 1280w, https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/tsa_2023_08-980x502.png 980w, https:\/\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/08\/tsa_2023_08-480x246.png 480w\" sizes=\"(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) and (max-width: 1280px) 1280px, (min-width: 1281px) 1920px, 100vw\" \/><\/a><\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport pandas as pd\r\nimport numpy as np\r\nimport math\r\nimport matplotlib.pyplot as plt\r\nfrom plotnine import ggplot, geom_point, aes, stat_smooth, facet_wrap,geom_smooth,labs, scale_x_continuous,geom_line\r\nfrom plotnine import *\r\n\r\nimport matplotlib\r\nprint(matplotlib.__version__)\r\ndf=pd.read_csv(&quot;data_tsa2.txt&quot;, delimiter=r&quot;\\s+&quot;)\r\n\r\na2019=(\r\n    ggplot(df) +\r\n    geom_line(aes(x = 'Date', y = 'c2019',colour ='&quot;blue&quot;'),size=0.1) +\r\n    geom_point(aes(x = 'Date', y = 'c2019',color='&quot;blue&quot;'),size=0.2) +\r\n    geom_smooth(aes(x = 'Date', y = 'c2019',color='&quot;blue&quot;'),span=.3,size=1.0) +\r\n    \r\n    geom_line(aes(x = 'Date', y = 'c2020',colour = '&quot;black&quot;'),size=0.1) +    \r\n    geom_point(aes(x = 'Date', y = 'c2020',color='&quot;black&quot;'),size=0.2) +\r\n    geom_smooth(aes(x = 'Date', y = 'c2020',color='&quot;black&quot;'),span=.1,size=1.0) +\r\n\r\n    geom_line(aes(x = 'Date', y = 'c2021',colour = '&quot;green&quot;'),size=0.1) +    \r\n    geom_point(aes(x = 'Date', y = 'c2021',color='&quot;green&quot;'),size=0.2) +\r\n    geom_smooth(aes(x = 'Date', y = 'c2021',color='&quot;green&quot;'),span=.3,size=1.0) +\r\n    \r\n    geom_line(aes(x = 'Date', y = 'c2022',colour = '&quot;orange&quot;'),size=0.1) +    \r\n    geom_point(aes(x = 'Date', y = 'c2022',color='&quot;orange&quot;'),size=0.2) +\r\n    geom_smooth(aes(x = 'Date', y = 'c2022',color='&quot;orange&quot;'),span=.3,size=1.0) +\r\n\r\n    geom_line(aes(x = 'Date', y = 'c2023',colour = '&quot;red&quot;'),size=0.1) +    \r\n    geom_point(aes(x = 'Date', y = 'c2023',color='&quot;red&quot;'),size=0.2) +\r\n    geom_smooth(aes(x = 'Date', y = 'c2023',color='&quot;red&quot;'),span=.3,size=1.0) +\r\n    scale_x_continuous(breaks=range(0,365,14)) +\r\n    theme(text=element_text(family=&quot;Tahoma&quot;, size=10)) +\r\n    scale_colour_manual(name = &quot;Years&quot;, values = &#x5B;&quot;blue&quot;,&quot;black&quot;,\r\n                                                  &quot;green&quot;,&quot;orange&quot;,&quot;red&quot;],\r\n                      labels = &#x5B;'2019','2020','2021','2022','2023']) +\r\n    labs(title='Number of passengers at USA Airport TSA checkpoints',\r\n           x='Day #',\r\n           y='Number of Passengers')\r\n    )\r\n\r\np1=print(a2019)\r\nplt.savefig('ex372.png', dpi=300)\r\nplt.show()\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Good news for the aerospace industry because the number of passengers passing through TSA checkpoints this year is the same as in 2019 (before COVID-19). import pandas as pd import numpy as np import math import matplotlib.pyplot as plt from plotnine import ggplot, geom_point, aes, stat_smooth, facet_wrap,geom_smooth,labs, scale_x_continuous,geom_line from plotnine import * import matplotlib print(matplotlib.__version__) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_lmt_disableupdate":"yes","_lmt_disable":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[90,38],"tags":[],"class_list":["post-1912","post","type-post","status-publish","format-standard","hentry","category-aerospace","category-engineering"],"modified_by":"gantovnik","jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8bH0k-uQ","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1452,"url":"https:\/\/gantovnik.com\/bio-tips\/2022\/05\/210-parametric-curve-in-3d-2-2-2-2-2-2-2-2-2-2-2-2-2-3-2-2-2-2-2-2-2-2-2-3-2-2-2-2\/","url_meta":{"origin":1912,"position":0},"title":"#280 TSA data plot using R","author":"gantovnik","date":"2022-05-03","format":false,"excerpt":"Number of passengers at USA Airport TSA checkpoints for 2019, 2020, 2021 and 2022 [code language=\"python\"] install.packages('xml2') install.packages('rvest') install.packages('tidyverse') install.packages('janitor') #install.packages('themeani') #install.packages(\"ggplot2\") #install.packages(\"magrittr\") #install.packages(\"dplyr\") library('xml2') library(rvest) library(tidyverse) library(ggplot2) library(dplyr) library('xml2') library(rvest) library(tidyverse) #read_html(\"https:\/\/www.tsa.gov\/coronavirus\/passenger-throughput?page=0\") -> myurl #html_table(myurl, header = TRUE, fill = TRUE) -> tsa #working directory setwd(\"D:\/projects\/wordpress\/ex280_tsa\") tsa <- read.table(\"data_tsa.txt\",\u2026","rel":"","context":"In &quot;R&quot;","block_context":{"text":"R","link":"https:\/\/gantovnik.com\/bio-tips\/category\/r\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/05\/tsa_2022_05-1.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/05\/tsa_2022_05-1.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2022\/05\/tsa_2022_05-1.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":579,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/06\/84\/","url_meta":{"origin":1912,"position":1},"title":"#84 Volcano plot for gene expression using R","author":"gantovnik","date":"2020-06-15","format":false,"excerpt":"[code language=\"python\"] library(\"readxl\") library(\"ggplot2\") #Best plots library(\"ggrepel\") #Avoid overlapping labels library(\"dplyr\") #set working directory where all files are located getwd() setwd(\"D:\\\\projects\\\\ex89\") getwd() df <- read_excel(\"data.xlsx\") i=3 k_array = c(2,4,6) label_array = c(\"DC\",\"SC\",\"PC\") k <- k_array[i] label <- label_array[i] df = df[c(1,k,k+1)] colnames(df) <- c(\"gene\",\"log_fc\",\"pvalue\") df <- df[- grep(\"NA\", df$gene),] #\u2026","rel":"","context":"In &quot;bioinformatics&quot;","block_context":{"text":"bioinformatics","link":"https:\/\/gantovnik.com\/bio-tips\/category\/bioinformatics\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/06\/Volcanoplot_DC.jpeg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/06\/Volcanoplot_DC.jpeg?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/06\/Volcanoplot_DC.jpeg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/06\/Volcanoplot_DC.jpeg?resize=700%2C400 2x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/06\/Volcanoplot_DC.jpeg?resize=1050%2C600 3x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/06\/Volcanoplot_DC.jpeg?resize=1400%2C800 4x"},"classes":[]},{"id":654,"url":"https:\/\/gantovnik.com\/bio-tips\/2020\/09\/107-tsa-data-2020-vs-2019\/","url_meta":{"origin":1912,"position":2},"title":"#107: TSA Data 2020 vs 2019","author":"gantovnik","date":"2020-09-28","format":false,"excerpt":"#107: TSA Data 2020 vs 2019 The TSA has started to publish the daily volume of passengers going through checkpoints on its website. The data set also includes the numbers from 2019 in order to measure the impact of travel as a result of COVID-19. https:\/\/www.tsa.gov\/coronavirus\/passenger-throughput [code language=\"python\"] from bs4\u2026","rel":"","context":"In &quot;python&quot;","block_context":{"text":"python","link":"https:\/\/gantovnik.com\/bio-tips\/category\/python\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/09\/ex107.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/09\/ex107.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/09\/ex107.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/09\/ex107.png?resize=700%2C400 2x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/09\/ex107.png?resize=1050%2C600 3x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2020\/09\/ex107.png?resize=1400%2C800 4x"},"classes":[]},{"id":1971,"url":"https:\/\/gantovnik.com\/bio-tips\/2023\/11\/ex394\/","url_meta":{"origin":1912,"position":3},"title":"#394 Scatter plot of helix using matplotlib","author":"gantovnik","date":"2023-11-09","format":false,"excerpt":"[code language=\"python\"] import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np from numpy import sin, cos import pandas as pd fig = plt.figure() # preferred method for creating 3d axis ax = fig.add_subplot(111, projection='3d') r = 10 c = 2 t = np.linspace(0, 20, 400) # parametric\u2026","rel":"","context":"In &quot;matplotlib&quot;","block_context":{"text":"matplotlib","link":"https:\/\/gantovnik.com\/bio-tips\/category\/matplotlib\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/11\/ex394.png?fit=640%2C480&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/11\/ex394.png?fit=640%2C480&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2023\/11\/ex394.png?fit=640%2C480&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":2158,"url":"https:\/\/gantovnik.com\/bio-tips\/2024\/05\/421-plot-a-pandas-data-frame-for-loops-on-columns\/","url_meta":{"origin":1912,"position":4},"title":"#421 Plot a pandas data frame for loops on columns","author":"gantovnik","date":"2024-05-04","format":false,"excerpt":"[code language=\"python\"] import numpy as np import pandas as pd import matplotlib.pyplot as plt np.random.seed(2023) df = pd.DataFrame({ \"x\": np.linspace(0, 1, 10), \"A\": np.random.rand(10), \"B\": np.random.rand(10), \"C\": np.random.rand(10), }) for column in df: if column != 'x': plt.plot(df['x'], df[column],label=f\"x vs. {column}\") plt.scatter(df['x'], df[column]) plt.title(\"Performance\") plt.grid() plt.xlabel('x') plt.ylabel('Efficiency') plt.legend() plt.show() plt.savefig('ex421.png',\u2026","rel":"","context":"In &quot;matplotlib&quot;","block_context":{"text":"matplotlib","link":"https:\/\/gantovnik.com\/bio-tips\/category\/matplotlib\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/05\/ex421.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/05\/ex421.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2024\/05\/ex421.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":5,"url":"https:\/\/gantovnik.com\/bio-tips\/2016\/12\/example-1-interpolation\/","url_meta":{"origin":1912,"position":5},"title":"Example 1: Interpolation","author":"gantovnik","date":"2016-12-08","format":false,"excerpt":"Example 1: Interpolation [code language=\"python\"] #Example 1: Interpolation import numpy as np from scipy import interpolate import matplotlib.pyplot as plt import os os.chdir('C:\\\\Anaconda\\\\mycodes\\\\aerospace') os.getcwd() #create the data points and add noise as follows x = np.linspace(-18,18,36) noise = 0.1 * np.random.random(len(x)) signal = np.sinc(x) + noise #create a linear interpolation\u2026","rel":"","context":"In &quot;matplotlib&quot;","block_context":{"text":"matplotlib","link":"https:\/\/gantovnik.com\/bio-tips\/category\/matplotlib\/"},"img":{"alt_text":"example1","src":"https:\/\/i0.wp.com\/gantovnik.com\/bio-tips\/wp-content\/uploads\/2016\/12\/example1-300x200.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/comments?post=1912"}],"version-history":[{"count":0,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/posts\/1912\/revisions"}],"wp:attachment":[{"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/media?parent=1912"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/categories?post=1912"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gantovnik.com\/bio-tips\/wp-json\/wp\/v2\/tags?post=1912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}