<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sebastian Boesch on Medium]]></title>
        <description><![CDATA[Stories by Sebastian Boesch on Medium]]></description>
        <link>https://medium.com/@sebasb79?source=rss-662335dc79d9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*22cs_Oo3wF7pvrAy</url>
            <title>Stories by Sebastian Boesch on Medium</title>
            <link>https://medium.com/@sebasb79?source=rss-662335dc79d9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:49:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sebasb79/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[A Pipeline for Gans]]></title>
            <link>https://medium.com/@sebasb79/a-pipeline-for-gans-ee0c45132687?source=rss-662335dc79d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee0c45132687</guid>
            <dc:creator><![CDATA[Sebastian Boesch]]></dc:creator>
            <pubDate>Thu, 11 Aug 2022 12:00:30 GMT</pubDate>
            <atom:updated>2022-08-11T12:00:30.912Z</atom:updated>
            <content:encoded><![CDATA[<h4>data engineering for data scientists</h4><p>This is the fictional scenario of “Gans”. Imagine you establish an e-Scooter-sharing transportation system because you care about sustainable mobility. A smart way to do that is to dispose your Scooters on demand. Prospect for the best locations by collecting as many useful information as possible, and keeping them up to date. The goal is to automatically process the data. For this case we collect information such as population of european cities, scheduled arrivals on their airports, weather forecast, and maybe more. Our working environment is python with pandas library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/128/1*meSNtydAgZQ1YD2M2kN9Nw.png" /></figure><h4>hunt for data anywhere</h4><p>Basically you can source sheets of paper as long as you digitalize the information. You will find more information on the Internet.</p><p><em>from bs4 import BeautifulSoup</em></p><p>This python library uses css selectors to <strong>scrape websites</strong> by targeting html tags. In case all table rows have the same number of columns just iterate through ‘tbody tr td’ and simply .get_text(). A good choice for persistent knowledge such as cities and their airports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*Rqc310wcMzBsaWoLiunvmQ.png" /><figcaption>table iteration for beginners</figcaption></figure><p><em>import requests</em></p><p>Sending a request to an <strong>API</strong> (application programming interface) result in a .json file that consist of a dictionary. Typically time-sensitive information like weather and flights is provided that way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*YYNBoNK3PQMqNY7iROypww.png" /><figcaption>singular weather event (openweathermap.org)</figcaption></figure><p>draw API response (.json content) into your dataframe:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EI6wC97VXTHDemt6zJ0wJA.png" /><figcaption>http://subdomain.domain.tld/dir/file.format?key1=value&amp;key2=value</figcaption></figure><p>RapidAPI.com maintains a large collection of useful API’s with code generator for many languages. This is a sample aircraft movement (arrival) from AeroDataBox API:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*BscV5Ize0nJHu0aJyOeBTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/128/1*ffJ6qpR11bb22yxHsEe-Ng.png" /></figure><h4>build your own data warehouse</h4><p>Which information is helpful to advance your knowledge to the business case, and which is not? The collected data are to be stored in a database (here: located in the cloud). The rules of a SQL database accepting input is very strict, in order to keep the stored data consistent and accurate. Tables have relations, they are connected through primary (unique) and foreign keys.</p><p>Define your key structure prior to fill it. Connect database with MySQL Workbench and create your tables manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*mcopu3vzOCGIjuj7dYQFhQ.png" /></figure><p>You can also view and modify relations directly on the Entity-Relationship-Model. Goto menu Database/Reverse Engineer or Shortcut “CTRL+R”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*bOsv-iglgEUmTJkgoxaePw.png" /><figcaption>gans db schema</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/128/1*OtmdxaEbN2mHx4N67NekFQ.png" /></figure><h4>the magic of Pandas</h4><p>While thinking about Pandas Dataframes I become really excited. They are kind of temporary working tables, allow you to perform rapid operations on your values. With some practise you can dribble data like once Diego Maradona drank the cat’s milk. Split and strip the data, clean it, drop it, fill it up, pivot it. Perform aggregations, merge and concatenate, fly to the moon. Consider that as one-liner. Intend processing your data to get them in shape for the return.</p><p><em>import sqlalchemy; import pymysql</em></p><p>Simply connect to your database and upload your dataframe into a SQL table with a code like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*GzjHvbAziK8K2lXYCBCIZg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/128/1*jQOl_6xz3Kk4d1kqHqNMSw.png" /></figure><h4>a smart home in the cloud</h4><p>Automate your process by creating events that trigger your process to run on specific occasions. To update our weather and arrivals we use AWS Lambda, a function as a service provided by Amazon, where to place the code as function lambda_handler():</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*ZP-iTx3mk_5_eXi_qnSJIw.png" /></figure><p>Associate a trigger (AWS EventBridge) that executes the process, for instance at specific moments. Schedule your timer with a cron-command. For running each twelve hours at 0200 and 1400 UTC the trigger will be cron(0 2,14 ? * * * ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*uXunyKYMCVxaxSYtpoUDHg.png" /><figcaption>cron job</figcaption></figure><h4>continuous improvement</h4><p>Increasing your knowledge by adding information gives you supreme advantage. How likely e-Scooters will be stolen? Connect new insights to your existing database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*ajCtLXBmupMPcjtoOMULPg.png" /></figure><p>This is just an example of how the job can be done. In general, the steps described here are mapped as followed:</p><p>get data | process with pandas | move database and scripts to the cloud | automation with with triggers</p><p>There are many ways to solve that. If you are a webdesigner, you may have your own database for global access. A basic but remarkable approach to upload your script is &lt;py-script&gt;, a new project (2022) driven by Anaconda.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee0c45132687" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>