<?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 Vina Maulina Sofyani on Medium]]></title>
        <description><![CDATA[Stories by Vina Maulina Sofyani on Medium]]></description>
        <link>https://medium.com/@vinamaulinasofyani17?source=rss-1da30ede411a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Clv06dZjLt_LljsQ9uTkRQ.jpeg</url>
            <title>Stories by Vina Maulina Sofyani on Medium</title>
            <link>https://medium.com/@vinamaulinasofyani17?source=rss-1da30ede411a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 21:11:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vinamaulinasofyani17/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[#8WeeksSQLChallenge Case Study #1 : Danny’s Dinner]]></title>
            <link>https://vinamaulinasofyani17.medium.com/8weekssqlchallenge-case-study-1-dannys-dinner-5bc189005adf?source=rss-1da30ede411a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bc189005adf</guid>
            <dc:creator><![CDATA[Vina Maulina Sofyani]]></dc:creator>
            <pubDate>Fri, 25 Feb 2022 08:02:19 GMT</pubDate>
            <atom:updated>2022-02-25T08:02:19.701Z</atom:updated>
            <content:encoded><![CDATA[<h4>#8WeeksSQLChallenge Case Study #1 : Danny’s Dinner</h4><p>Hello welcome back to my article about data analyst. At this time i made this article use to query SQL. You cand find this dataset <a href="https://8weeksqlchallenge.com/case-study-1/">here</a>, and i share the full syntax on <a href="https://github.com/vinasofyani/-8WeekSQLChallenge---Danny-s-Dinner/blob/main/SQLQuery1.sql">Github </a>too</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*suXNCt1BLFivY0AXlqAT5g.png" /><figcaption><a href="https://8weeksqlchallenge.com/case-study-1/">https://8weeksqlchallenge.com/case-study-1/</a></figcaption></figure><h4><strong>Introduction</strong></h4><p>Danny seriously loves Japanese food so in the beginning of 2021, he decides to embark upon a risky venture and opens up a cute little restaurant that sells his 3 favourite foods: sushi, curry and ramen.</p><p>Danny’s Diner is in need of your assistance to help the restaurant stay afloat — the restaurant has captured some very basic data from their few months of operation but have no idea how to use their data to help them run the business.</p><h4><strong>Problem Statement</strong></h4><p>Danny wants to use the data to answer a few simple questions about his customers, especially about their</p><p>· visiting patterns</p><p>· how much money they’ve spent</p><p>· which menu items are their favourite.</p><p>Having this deeper connection with his customers will help him deliver a better and more personalised experience for his loyal customers. He plans on using these insights to help him decide whether he should expand the existing customer loyalty program — additionally he needs help to generate some basic datasets so his team can easily inspect the data without needing to use SQL. Danny has provided you with a sample of his overall customer data due to privacy issues — but he hopes that these examples are enough for you to write fully functioning SQL queries to help him answer his questions!. Danny has shared with you 3 key datasets for this case study:</p><p>· sales</p><p>· menu</p><p>· members</p><p>You can inspect the entity relationship diagram and example data below.</p><h4><strong>Table Relationship</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*-188_CpehgpWrkUOUnitxQ.png" /><figcaption>dbdiagram.io</figcaption></figure><h4><strong>Case Study Questions</strong></h4><p>Each of the following case study questions can be answered using a single SQL statement:</p><p>1. What is the total amount each customer spent at the restaurant?</p><p>2. How many days has each customer visited the restaurant?</p><p>3. What was the first item from the menu purchased by each customer?</p><p>4. What is the most purchased item on the menu and how many times was it purchased by all customers?</p><p>5. Which item was the most popular for each customer?</p><p>6. Which item was purchased first by the customer after they became a member?</p><p>7. Which item was purchased just before the customer became a member?</p><p>8. What is the total items and amount spent for each member before they became a member?</p><p>9. If each $1 spent equates to 10 points and sushi has a 2x points multiplier — how many points would each customer have?</p><p>10. In the first week after a customer joins the program (including their join date) they earn 2x points on all items, not just sushi — how many points do customer A and B have at the end of January?</p><h4>The Answer Of The Questions</h4><ol><li><strong>What is the total amount each customer spent at the restaurant?</strong></li></ol><p>To search the total price for each customer during their visit to the restaurant, we will use the SUM function to add up the prices and use GROUP BY to group by each customer.</p><pre>SELECT s.customer_id, SUM (m.price) as amount<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id=m.product_id<br>GROUP BY s.customer_id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*JN-JsvKbUa5AKgCX_-gMFQ.png" /></figure><p>Answer :</p><p>· Cust A membayar 76</p><p>· Cust B membayar 74</p><p>· Cust C membayar 36</p><p>2. <strong>How many days has each customer visited the restaurant?</strong></p><p>Will use COUNT DISTINCT to avoid double counting data in the order_date column, and use GROUP BY to group each customer in the customer_Id column</p><pre>SELECT s.customer_id,COUNT(DISTINCT(order_date)) as times<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id=m.product_id<br>GROUP BY s.customer_id</pre><p>· A visited for 4 times</p><p>· B visited for 6 times</p><p>· C visited for 2 times</p><p><strong>3. What was the first item from the menu purchased by each customer?</strong></p><p>Create a new table with the rank name using DENSE_RANK () OVER(PARTITION BY… ORDER BY) which is partitioned or separated by customer (using PARTITION BY) and sorted from the lowest date (using ORDER BY from the order_date column)</p><pre>SELECT s.customer_id, m.product_name, s.order_date, DENSE_RANK () OVER (PARTITION BY s.customer_id ORDER BY s.order_date)AS rank<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id=m.product_id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*64GflKw3OHvxTGzSXJYDig.png" /></figure><p>We substitute the query above into the following where only rank = 1 is displayed based on the grouping of customer_id, product_name.</p><pre>SELECT customer_id, product_name<br>FROM<br>(SELECT s.customer_id, m.product_name, s.order_date, DENSE_RANK () OVER (PARTITION BY s.customer_id ORDER BY s.order_date)AS rank<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id=m.product_id) a<br>WHERE rank =1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/1*blQCIU1uDDZnR3oMSUc9_A.png" /></figure><p>· The first item A ordered was sushi and curry</p><p>· The first item B ordered was curry</p><p>· The first item C ordered was ramen</p><p><strong>4. What is the most purchased item on the menu and how many times was it purchased by all customers?</strong></p><p>To see the one top data, TOP 1 is used in the query below, GROUP BY is used to group by product_name column and ORDER BY is used to sort the column and DESC is ordered from the smallest number.</p><pre>SELECT TOP 1 m.product_name, COUNT(s.product_id) as times<br>FROM sales AS s<br>LEFT JOIN menu m ON s.product_id = m.product_id<br>GROUP BY m.product_name<br>ORDER BY times DESC</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*c61zaUMh9JlNMNeOXJ7kog.png" /></figure><p>the item that is most purchased by each customer is ramen which is ordered 8 times</p><p><strong>5. Which item was the most popular for each customer?</strong></p><p>Create a new column with the name product_number by using COUNT to count the number of products from the product_id column to find out which products are ordered by customers the most. Grouped by column customer_id, and product_name using GROUP BY</p><pre>SELECT s.customer_id, m.product_name, COUNT (s.product_id) as jumlah_produk<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id=m.product_id<br>GROUP BY s.customer_id, m.product_name</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*nyniJ7WeAFMenSHMBBm8jQ.png" /></figure><p><strong>6. Which item was purchased first by the customer after they became a member?</strong></p><p>In the question there are conditions ordered by the customer after becoming a member. Then use WHERE in the order_date and join_date columns. After that, the data is sorted to find the first order ordered by the customer by using ORDER BY and DENSE RANK to rank based on the partition in the customer_id column and then sorted by the order_date column.</p><pre>SELECT TOP 2 s.customer_id, m.product_name, s.order_date, ms.join_date<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id=m.product_id<br>LEFT JOIN members ms ON s.product_id=m.product_id<br>WHERE ms.join_date &lt;= s.order_date<br>ORDER BY DENSE_RANK () OVER (PARTITION BY s.customer_id ORDER BY s.order_date)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*WYjFjBwtSA_RCZLIImDJfQ.png" /></figure><p>Here is another query by creating a rank column first by using DENSE RANK() and then using ORDER BY to sort the ranking column.</p><pre>SELECT TOP 2 r.customer_id, m.product_name, r.order_date, r.join_date, DENSE_RANK () OVER (PARTITION BY r.customer_id ORDER BY r.order_date) as rangking<br>FROM (SELECT s.customer_id, m.product_name, s.order_date, ms.join_date<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id=m.product_id<br>LEFT JOIN members ms ON s.product_id=m.product_id<br>WHERE s.order_date &gt;= ms.join_date) as r<br>LEFT JOIN menu m ON r.product_name = m.product_name<br>ORDER BY rangking</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*2WyFIfB4UGSfsEagLKTRSw.png" /></figure><p><strong>7. Which item was purchased just before the customer became a member?</strong></p><p>Before the customer becomes a member, WHERE is used with the reference columns being the order_date and join_date columns.</p><pre>SELECT s.customer_id, m.product_name, s.order_date, ms.join_date<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id=m.product_id<br>LEFT JOIN members ms ON s.customer_id = ms.customer_id<br>WHERE s.order_date &lt; ms.join_date</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*ExUywxd2I3dLL95NB7HcQg.png" /></figure><p><strong>8. What is the total items and amount spent for each member before they became a member?</strong></p><p>DISTINCT is used to avoid counting product names that appear 2/3/4 times, which later will appear 1 time when using DISTINCT. Use SUM for the total price. Because what is asked for each customer is grouped using GROUP BY based on the customer_id column.</p><pre>SELECT s.customer_id, COUNT (DISTINCT s.product_id) AS unique_order, SUM (m.price) AS jumlah_harga<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id=m.product_id<br>LEFT JOIN members ms ON s.customer_id = ms.customer_id<br>WHERE s.order_date &lt; ms.join_date<br>GROUP BY s.customer_id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*kwrsC88wyAhj1ouLb9w3BQ.png" /></figure><p>· Total price of customer A order before became a member is $25</p><p>· Total price of customer B order before became a member is $40</p><p><strong>9. If each $1 spent equates to 10 points and sushi has a 2x points multiplier — how many points would each customer have?</strong></p><p>Will be broken down into 2 problems as follows<br>• Each payment of 1 dollar ramen and curry gets 10 points<br>• Every payment of 1 dollar sushi gets 2 x 10 points<br>Because there are two problems, we will be used CASE WHEN</p><pre>SELECT *,<br>CASE<br>WHEN m.product_name = &#39;sushi&#39; THEN m.price*20<br>ELSE m.price*10<br>END  AS points<br>FROM menu m</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*Ht5_mvbd7av5j38RA_BmUQ.png" /></figure><p><strong>10. In the first week after a customer joins the program (including their join date) they earn 2x points on all items, not just sushi — how many points do customer A and B have at the end of January?</strong></p><p>Same as number 9<br>Number 10 will be split into 2 problems<br>• Customers who order a week after becoming a member will get 2 x 10 points for all items. In this case, DATEADD will be used to add the number of days since the customer became a member for the first time<br>• Customers who order sushi will get 2 x 10 points in addition to sushi getting 10 points</p><pre>SELECT s.customer_id, m.product_name, s.order_date, ms.join_date, COUNT (s.product_id) AS jumlah_produk, DATEADD (DAY, 6, ms.join_date) AS aweek_from_joindate,<br>CASE<br>WHEN m.product_name = &#39;sushi&#39; THEN 2*10*m.price*COUNT(s.product_id)<br>WHEN  s.order_date BETWEEN ms.join_date AND DATEADD (DAY, 6, ms.join_date) THEN 2*10*m.price*COUNT (s.product_id)<br>ELSE m.price*10*COUNT (s.product_id)<br>END AS points<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id = m.product_id<br>LEFT JOIN members ms ON s.customer_id = ms.customer_id<br>WHERE s.order_date &lt;= &#39;2021-01-31&#39;<br>GROUP BY s.customer_id, m.product_name, s.order_date, ms.join_date, m.price</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*Tjj2XqYr3y0mpCchk2qv3g.png" /></figure><p>For the search sum points of each customer, this is for the synntax</p><pre>SELECT ts.customer_id, SUM (ts.points) as poinFROM (SELECT s.customer_id, m.product_name, s.order_date, ms.join_date, COUNT (s.product_id) AS jumlah_produk, DATEADD (DAY, 6, ms.join_date) AS aweek_from_joindate,<br>CASE<br>WHEN m.product_name = &#39;sushi&#39; THEN 2*10*m.price*COUNT(s.product_id)<br>WHEN  s.order_date BETWEEN ms.join_date AND DATEADD (DAY, 6, ms.join_date) THEN 2*10*m.price*COUNT (s.product_id)<br>ELSE m.price*10*COUNT (s.product_id)<br>END AS points<br>FROM sales s<br>LEFT JOIN menu m ON s.product_id = m.product_id<br>LEFT JOIN members ms ON s.customer_id = ms.customer_id<br>WHERE s.order_date &lt;= &#39;2021-01-31&#39;<br>GROUP BY s.customer_id, m.product_name, s.order_date, ms.join_date, m.price) AS ts<br>GROUP BY ts.customer_id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/1*Sjh-C2i_3StSxqy7pjo42A.png" /></figure><h4>Bonus Questions</h4><h4>Join All The Things</h4><p>The following questions are related creating basic data tables that Danny and his team can use to quickly derive insights without needing to join the underlying tables using SQL.</p><p>Recreate the table where the column name : customer_id, order_date, product_name, price, member (Y/N)</p><pre>SELECT s.customer_id, s.order_date, m.product_name, m.price,<br>CASE<br>WHEN s.order_date &lt; ms.join_date THEN &#39;N&#39;<br>WHEN s.order_date &gt;= ms.join_date THEN &#39;Y&#39;<br>ELSE &#39;N&#39;<br>END AS member<br>FROM sales as s<br>LEFT JOIN menu m ON s.product_id=m.product_id<br>LEFT JOIN members ms ON s.customer_id=ms.customer_id</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*Iv-Jo_hQS6yyX1FOwimB1Q.png" /></figure><h4>Rank All The Things</h4><p>Danny also requires further information about the ranking of customer products, but he purposely does not need the ranking for non-member purchases so he expects null ranking values for the records when customers are not yet part of the loyalty program.</p><pre>SELECT *,<br>CASE WHEN tb.member =&#39;N&#39; THEN NULL<br>ELSE RANK () OVER (PARTITION BY tb.customer_id, tb.member ORDER BY tb.order_date)<br>END as rank<br>FROM (SELECT s.customer_id, s.order_date, m.product_name, m.price,<br>CASE<br>WHEN s.order_date &lt; ms.join_date THEN &#39;N&#39;<br>WHEN s.order_date &gt;= ms.join_date THEN &#39;Y&#39;<br>ELSE &#39;N&#39;<br>END AS member<br>FROM sales as s<br>LEFT JOIN menu m ON s.product_id=m.product_id<br>LEFT JOIN members ms ON s.customer_id=ms.customer_id) AS tb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*e6-hMqjkam4tEk7yOyvc4A.png" /></figure><h4>Insights</h4><p>From the analysis that has been made there are answers to useful questions for restaurant danny</p><p>· Customer B most often visits the restaurant, which is 6 times</p><p>· Ramen is a favorite food</p><p>· Ramen is a favorite food that is often ordered by customers A and C</p><p>· Ramen ordered 8 times by customer</p><p>· The total paid by customers A and B before becoming a member is $25 and $40</p><p>· The number of customer points A, B and C at the end of January is 1370, 820, 360 points</p><p>Thank You !</p><p>I will share my analysis again about data for the next time</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bc189005adf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploratory Analisis Data COVID-19 di Indonesia Menggunakan Python]]></title>
            <link>https://vinamaulinasofyani17.medium.com/exploratory-analisis-data-covid-19-di-indonesia-menggunakan-python-fc9a1a257c64?source=rss-1da30ede411a------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc9a1a257c64</guid>
            <category><![CDATA[covid19]]></category>
            <category><![CDATA[scraping]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Vina Maulina Sofyani]]></dc:creator>
            <pubDate>Tue, 23 Feb 2021 18:35:04 GMT</pubDate>
            <atom:updated>2021-02-23T18:35:04.759Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*7e1PhvrzSSE6HDt9lJ6TYg.jpeg" /><figcaption>Sumber : klikdokter.com</figcaption></figure><p>Haloooo readers !! ini merupakan artikel pertama aku yang membahas tentang COVID-19 di Indonesia. Pada pembahasan ini aku menganalisis perkembangan COVID-19 dengan menggunakan python yang menggunakan scrapping web menggunakan <strong>json</strong> yang diambil dari data<strong> covid19.go.id. </strong>Okee kitaa mulai saja analisis nya dari latar belakang</p><p><strong>Latar Belakang</strong></p><p>COVID-19 merupakan penyakit yang saat ini telah menjadi pandemi secara global. Kondisi ini menjadi semakin bertambah dari hari ke hari. Pemerintah dari berbagai negara dengan sigap membentuk gugus tugas untuk menangani penyebaran COVID-19 di masyarakat, termasuk pemerintah di Indonesia. Salah satu bentuk aksi yang dilakukan pemerintah adalah dengan mengumpulkan dan menyediakan data pertumbuhan kasus COVID-19 kepada publik. Data pertumbuhan kasus tersebut kebanyakan dilengkapi dengan dasbor dan grafik visualisasi pendukung dengan harapan masyarakat dapat memahami informasi dengan lebih mudah. Sebagai contoh yang terdapat pada portal <strong>covid19.go.id</strong>. Nah pada portal tersebut nantinya yang akan di analisis untuk kasus covid-19.</p><p><strong>Langkah-langkah yang harus dilakukan</strong></p><p>Data yang akan digunakan diambil langsung dari <strong>API (Application Programming Interface)</strong> yang tersedia di <strong>covid19.go.id. </strong>Sehingga dalam project ini akan dijelaskan teknik mengambil data dari API, teknik mempersiapkan data, dan visualisasi data.</p><p><strong>Teknik mengambil data dari API</strong></p><p>Seperti yang sudah dijelaskan sebelumnya bahwa portal yang akan digunakan adalah <strong>covid19.go.id</strong>. Pada portal ini kita dapati bahwa data dari <strong>covid19.go.id</strong> terdapat pada API public yang beralamat <a href="https://data.covid19.go.id/public/api/update.json"><strong>https://data.covid19.go.id/public/api/update.json</strong></a>. Langkah pertama yang dilakukan adalah mengaktifkan <strong>library requests</strong>. Setelah itu kita akses API. Untuk mengakses API, akan digunakan fungsi <strong>get()</strong> yang tersedia dalam <strong>library requests</strong>. Fungsi tersebut disimpan dalam objek bernama response</p><pre>import requests<br>api_url = <a href="https://data.covid19.go.id/public/api/update.json">https://data.covid19.go.id/public/api/update.json</a><br>resp = requests.get (api_url)</pre><p><strong>Evaluasi Respon</strong></p><p>Dalam respon API terdapat tiga informasi utama yaitu</p><p><strong>Status</strong> : Berfungsi untuk melihat permintaan apakah berhasil atau tidak yang berupa sebuah code. Apabila terdapat code <strong>200</strong> maka permintaan sukses, <strong>404</strong> artinya berkas yang diminta tidak dapat ditemukan, <strong>500</strong> artinya permintaan ditolak, <strong>501</strong> artinya terjadi kesalahan pada server. Untuk mengetahui status dari API terdapat source code berikut</p><pre>print (resp.status_code)</pre><pre>200</pre><p>Respon API dengan status code 200 menyatakan bahwa permintaan berhasil dipenuhi dan konten yang diminta tersedia.</p><p><strong>Headers </strong>: Melihat informasi metadata yang terdapat pada source code berikut</p><pre>print (resp.headers)</pre><pre>{&#39;Server&#39;: &#39;nginx&#39;, &#39;Date&#39;: &#39;Fri, 19 Feb 2021 08:33:28 GMT&#39;, &#39;Content-Type&#39;: &#39;application/json&#39;, &#39;Transfer-Encoding&#39;: &#39;chunked&#39;, &#39;Connection&#39;: &#39;keep-alive&#39;, &#39;Vary&#39;: &#39;Accept-Encoding, Accept-Encoding&#39;, &#39;Last-Modified&#39;: &#39;Tue, 16 Feb 2021 09:29:50 GMT&#39;, &#39;ETag&#39;: &#39;W/&quot;602b908e-14827&quot;&#39;, &#39;X-Content-Type-Options&#39;: &#39;nosniff, nosniff&#39;, &#39;X-XSS-Protection&#39;: &#39;1; mode=block, 1; mode=block&#39;, &#39;Strict-Transport-Security&#39;: &#39;max-age=31536000; includeSubDomains; preload&#39;, &#39;Content-Encoding&#39;: &#39;gzip&#39;}</pre><p>Dari hasil output yang didapat, content-type tersebut tersedia dalam bentuk application/json, atau dalam berupa berkas <strong>JSON</strong>. Karena berkas yang tersedia sudah dalam bentuk json, maka selanjutnya dapat mengekstrak konten tersebut dengan menggunakan method <strong>json()</strong>. Method <strong>json()</strong> merupakan builtin <strong>JSON</strong> recorder untuk mengekstrak content bertipe <strong>JSON</strong>. Jalankan method json() kemudian simpan dalam <strong>cov_id_raw</strong>.</p><pre>cov_id_raw = resp.json()</pre><p><strong>Body</strong> : Berisi konten dari permintaan yang dibuat</p><p><strong>Ekstrak isi respon</strong></p><p>Dengan menggunakan fungsi <strong>len()</strong> dan method <strong>keys()</strong> akan diketahui banyaknya komponen dan mengetahui komponen apa saja yang terdapat dalam <strong>cov_id_raw</strong>. Setelah itu ekstraklah key ke-2 dan simpan dengan nama <strong>cov_id_update</strong>.</p><pre>print (&#39;Length of cov_id_raw : %d&#39;, %len(cov_id_raw))<br>print (&#39;Komponen cov_id_raw : %s&#39;, %cov_id_raw.keys())<br>cov_id_update = cov_id_raw [&#39;update&#39;]</pre><pre>Length of cov_id_raw :2.<br>Komponen cov_id_raw : dict_keys([&#39;data&#39;, &#39;update&#39;]).</pre><p>Pada komponen cov id raw terlihat bahwa terdapat 2 list yaitu list data dan list update. List merupakan kumpulan dari beberapa vektor maupun dataframes. Jadi di dalam list masih terdapat banyak kumpulan data dan masing-masing tipe data.</p><p><strong>Analisa data</strong></p><p>Kita akan menganalisa data dari objek <strong>cov_id_update</strong> dengan pertanyaan-pertanyaan sebagai berikut.</p><p>· Kapan tanggal pembahuruan data penambahan kasus ?</p><p>· Berapa jumlah penambahan kasus sembuh ?</p><p>· Berapa jumlah penambahan kasus meningaal ?</p><p>· Berapa jumlah total kasus positif hingga saat ini ?</p><p>· Berapa jumlah total kasus meninggal hingga saat ini ?</p><pre>print (&#39;Tanggal terbaru data penambahan kasus : &#39;, cov_id_update[&#39;penambahan&#39;][&#39;tanggal&#39;])<br>print (&#39;Jumlah penambahan kasus sembuh : &#39;, cov_id_update[&#39;penambahan&#39;][&#39;jumlah_sembuh&#39;])<br>print (&#39;Jumlah penambahan kasus meninggal : &#39;, cov_id_update[&#39;penambahan&#39;][&#39;jumlah_meninggal&#39;])<br>print (&#39;Jumlah total kasus positif hingga saat ini : &#39;, cov_id_update [&#39;penambahan&#39;][&#39;jumlah_positif&#39;])<br>print (&#39;Jumlah total kasus meninggal hingga saat ini : &#39;, cov_id_update [&#39;penambahan&#39;][&#39;jumlah_meninggal&#39;])</pre><pre>Tanggal terbaru data penambahan kasus : 2021-02-19<br>Jumlah penambahan kasus sembuh : 10783<br>Jumlah penambahan kasus meninggal : 183<br>Jumlah total kasus positif hingga saat ini : 10614<br>Jumlah total kasus meninggal hingga saat ini :  183</pre><p><strong>Bagaimana dengan COVID-19 di Jawa Timur ?</strong></p><p>Pada sebelumnya telah dilakukan tentang analisis data COVID-19 yang ada di Indonesia dengan menggunakan data yang langsung diambil dari <strong>covid19.go.id. </strong>Namun bagaimana jika ingin berfokus pada data COVID-19 yang ada di Jawa Timur?</p><p>Untuk setiap provinsi,<strong> covid19.go.id </strong>menyediakan data dalam API yang berbeda. Pada Provinsi Jawa Timur datanya tersedia di <a href="https://data.covid19.go.id/public/api/prov_detail_JAWA_TIMUR.json"><strong>https://data.covid19.go.id/public/api/prov_detail_JAWA_TIMUR.json</strong></a><strong>. </strong>Untuk cara akses API nya masih sama seperti pada cara yang sebelumnya. Akses API nya akan disimpan dalam <strong>cov_jatim_raw</strong>. Berikut source codenya.</p><pre>jatim_url = &quot;<a href="https://data.covid19.go.id/public/api/prov_detail_JAWA_TIMUR.json">https://data.covid19.go.id/public/api/prov_detail_JAWA_TIMUR.json</a>&quot;<br>resp_jatim = requests.get(jatim_url)<br>cov_jatim_raw = resp_jatim.json()</pre><p><strong>Analisa COVID-19 di Jawa Timur</strong></p><p>Sebelum menganalisa data COVID-19 di Jawa Timur kita harus mengetahui komponen apa saja yang terdapat pada <strong>cov_jatim_raw</strong> menggunakan method <strong>keys ()</strong> untuk menjawab pertanyaan-pertanyaan berikut.</p><p>· Berapa jumlah total kasus COVID-19 di Jawa Timur ?</p><p>· Berapa persentase kematian akibat COVID-19 di Jawa Timur ?</p><p>· Berapa persentase tingkat kesembuhan COVID-19 di Jawa Timur ?</p><pre>print (&#39;Nama-nama komponen cov_jatim_raw : %s.&#39; %cov_jatim_raw.keys())<br>print (&#39;\n Jumlah total kasus COVID-19 di Jawa Timur : %d&#39;%cov_jatim_raw [&#39;kasus_total&#39;])<br>print (&#39;\n Persentase kematian akibat COVID-19 di Jawa Timur : %f.2%%&#39; %cov_jatim_raw[&#39;meninggal_persen&#39;])<br>print (&#39;\n Persentase tingkat kesembuhan dari COVID-19 di Jawa Timur : %f.2%%&#39; %cov_jatim_raw[&#39;sembuh_persen&#39;])</pre><pre><br>Nama-nama komponen cov_jatim_raw : dict_keys([&#39;last_date&#39;, &#39;provinsi&#39;, &#39;kasus_total&#39;, &#39;kasus_tanpa_tgl&#39;, &#39;kasus_dengan_tgl&#39;, &#39;meninggal_persen&#39;, &#39;meninggal_tanpa_tgl&#39;, &#39;meninggal_dengan_tgl&#39;, &#39;sembuh_persen&#39;, &#39;sembuh_tanpa_tgl&#39;, &#39;sembuh_dengan_tgl&#39;, &#39;list_perkembangan&#39;, &#39;data&#39;]).</pre><pre>Jumlah total kasus COVID-19 di Jawa Timur : 122807</pre><pre>Persentase kematian akibat COVID-19 di Jawa Timur : 6.674701.2%</pre><pre>Persentase tingkat kesembuhan dari COVID-19 di Jawa Timur : 84.876269.2%</pre><p>Informasi dari COVID-19 di Jawa Timur telah didapatkan. Namun, informasi ini akan lebih lengkap jika memiliki data perkembangan COVID-19 dari waktu ke waktu. Informasi tersebut juga disediakan oleh <strong>covid19.go.id </strong>melalui permintaan API yang telah dibuat sebelumnya. Data historis perkembangan COVID-19 tersebut tersimpan dengan nama <strong>list_perkembangan. </strong>Setelah itu ekstrak data dari <strong>cov_jatim_raw</strong> dan untuk lebih memudahkan dalam menginspeksi data ubah data bertipe <strong>dict </strong>ke <strong>pandas</strong> dataframe. Kemudian simpan hasilnya dengan objek bernama<strong> cov_jatim</strong>.</p><pre>import numpy as np<br>import pandas as pd</pre><pre>cov_jatim = pd.DataFrame (cov_jatim_raw [&#39;list_perkembangan&#39;])<br>print (&#39;Info cov_jatim :\n&#39;, cov_jatim.info())<br>print (&#39;Lima data teratas dari cov_jatim :\n&#39;, cov_jatim.head())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*7txskgvNJ1fLTJoUCHppWA.png" /></figure><p>Setelah mengekstrak data <strong>cov_jatim </strong>terdapat beberapa data yang tidak sesuai. Seperti pada kolom tanggal yang tidak sesuai dan format penulisan kolom yang tidak konsisten. Sekarang akan dilakukan beberapa tahapan untuk menyelesaikan permasalahan data sehingga dapat diolah dan dianalisis lebih mudah.</p><p>· Menghapus kolom <strong>DIRAWAT_OR_ISOLASI</strong> dan semua kolom yang berisi nilai kumulatif</p><p>· Merubah format penulisan semua kolom menjadi huruf kecil</p><p>· Mengganti nama kolom menjadi huruf kecil semua</p><p>· Memperbaiki tipe data pada kolom <strong>tanggal</strong> menggunakan <strong>pd.to_datetime</strong></p><pre>cov_jatim_tidy = (cov_jatim.drop (columns = [item for item in      cov_jatim.columns<br>                 if item.startswith (&#39;DIRAWAT&#39;)<br>                 or item.startswith (&#39;AKUMULASI&#39;)])<br>                .rename (columns=str.lower)<br>                .rename (columns={&#39;kasus&#39; : &#39;kasus_baru&#39;})<br>                                  )<br>cov_jatim_tidy [&#39;tanggal&#39;] = pd.to_datetime(cov_jatim_tidy[&#39;tanggal&#39;]*1e6,unit=&#39;ns&#39;)<br>print (&#39;Lima data teratas : \n&#39;, cov_jatim_tidy.head())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*3D5ODTE3q3C1gkYVs4ICtw.png" /></figure><p>Akhirnya data <strong>cov_jatim_tidy</strong> sudah selesai sehingga lebih mudah untuk diolah. Setelah itu, saatnya untuk mengekspresikan data tersebut dalam bentuk lain yang lebih mudah dicerna yaitu dalam bentuk visualisasi grafik. Untuk membuat visualisasi grafik yaitu dengan meng <strong>import library matplotlib</strong> terlebih dahulu.</p><p>Komponen untuk membat visualisasi antara lain adalah tabel data, kolom data, serta bentuk untuk mempresentasikan data. Untuk membuat scatter-plot yang diperlukan adalah bentuk geometri titik (<strong>.scatter()</strong>), line chart memerlukan garis (<strong>.plot()</strong>), sedangkan bar-chart memerlukan bentuk geometri batang atau kolom (<strong>.bar()</strong>). Berikut merupakan grafik <strong>bar-chart</strong> jumlah kasus baru harian COVID-19 di Jawa Timur menggunakan data <strong>cov_jatim_tidy</strong>.</p><pre>import matplotlib.pyplot as plt</pre><pre>plt.clf ()<br>fig, ax = plt.subplots(figsize=(10,5)) # untuk menentukan kerangka grafik dengan panjang 10 dan tinggi 5<br>ax.bar (data = cov_jatim_tidy, x = &#39;tanggal&#39;,height =&#39;kasus_baru&#39;) #plot data dengan menentukan sumbu x dan y nya<br>plt.show ()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*TAd7pUbRoa_h-AqLOvauJA.png" /></figure><p>Grafik bar chart telah selesai dibuat. Tapii, grafik tersebut belum menentukan informasi yang jelas. Sekarang akan dibuat grafik lagi dengan kode yang sudah dimodifikasi.</p><pre>plt.clf()<br>fig, ax = plt.subplots(figsize=(10,5))<br>ax.bar (data = cov_jatim_tidy, x = &#39;tanggal&#39;, height = &#39;kasus_baru&#39;, color = &#39;salmon&#39;)<br>fig.suptitle (&#39;Kasus Harian Positif COVID-19 di Jawa Barat&#39;, y=1.00, fontsize = 16, fontweight = &#39;bold&#39;, ha=&#39;center&#39;) <br>ax.set_title (&#39;Terjadi pelonjakan kasus di awal bulan Juli akibat klaster&#39;, fontsize=10)<br>ax.set_xlabel (&#39;&#39;)  <br>ax.set_ylabel (&#39;Jumlah kasus&#39;)<br>ax.text (1, -0.1, &#39;Sumber data : covid19.go.id&#39;, color =&#39;blue&#39;, ha = &#39;right&#39;, transform = ax.transAxes)</pre><pre>plt.grid(axis=&#39;y&#39;)<br>plt.tight_layout()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*DT1QMb8UaQPwGg4-Fj4QGQ.png" /></figure><p>Berikut ini merupakan source code dan hasil grafik dari kasus sembuh</p><pre>plt.clf()<br>fig, ax = plt.subplots(figsize=(10,5))<br>ax.bar (data = cov_jatim_tidy, x = &#39;tanggal&#39;, height = &#39;sembuh&#39;, color = &#39;olivedrab&#39;)<br>ax.set_title (&#39;Kasus Harian Sembuh Dari COVID-19 di Jawa Barat&#39;, fontsize = 22) <br>ax.set_xlabel (&#39;&#39;)<br>ax.set_ylabel (&#39;Jumlah kasus&#39;)<br>ax.text (1, -0.1, &#39;Sumber data : covid19.go.id&#39;, color =&#39;blue&#39;, ha = &#39;right&#39;, transform = ax.transAxes)<br>ax.xaxis.set_major_locator (mdates.MonthLocator())<br>ax.xaxis.set_major_formatter (mdates.DateFormatter(&#39;%b %Y&#39;))</pre><pre>plt.grid(axis=&#39;y&#39;)<br>plt.tight_layout()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*Rm4-nd7hjjqMqiU3KoR4yQ.png" /></figure><p>Berikut ini merupakan source code dan hasil grafik dari kasus meninggal</p><pre>plt.clf()<br>fig,ax = plt.subplots (figsize=(10,5))<br>ax.bar (data = cov_jatim_tidy, x=&#39;tanggal&#39;, height=&#39;meninggal&#39;, color=&#39;slategrey&#39;)<br>ax.set_title (&#39;Kasus Harian Meninggal Dari COVID-19 di Jawa Barat&#39;, y = 1.00, fontsize=16, fontweight=&#39;bold&#39;, ha=&#39;center&#39;)<br>ax.set_xlabel (&#39;&#39;)<br>ax.set_ylabel(&#39;Jumlah kasus&#39;)<br>ax.text (1, -0.1,&#39;Sumber data : covid19.go.id&#39;, color = &#39;blue&#39;, ha=&#39;right&#39;, transform = ax.transAxes)<br>ax.xaxis.set_major_locator (mdates.MonthLocator())<br>ax.xaxis.set_major_formatter(mdates.DateFormatter(&#39;%b %Y&#39;))</pre><pre>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*-6LfVtsk7FKCy01BvIPWGA.png" /></figure><p>Setelah mengamati perkembangan kasus harian, pada grafik tersebut terjadi fluktuasi petambahan kasus harian. Setelah itu, bagaimana perkembangan kasus dalam pekanan ? bagaimana caranaya ?</p><p>Langkah pertama yang dilakukan adalah dengan <strong>set kolom tanggal</strong> pada data <strong>cov_jatim_tidy</strong> menjadi <strong>index</strong>. Kemudian terapkan method time series pada pandas, <strong>resampling per pekan</strong> dan gunakan agregasi penjumlahan. Untuk mengekstrak informasi pekan dalam satu tahun digunakan <strong>weekofyear </strong>dan <strong>year</strong> untuk tahun. Simpanlah pada objek yang bernama <strong>cov_jatim_pekanan.</strong></p><pre>cov_jatim_pekanan = (cov_jatim_tidy.set_index (&#39;tanggal&#39;)<br>                     .resample (&#39;W&#39;)<br>                     .sum()<br>                     .reset_index()<br>                     .rename(columns = {&#39;kasus_baru&#39; : &#39;jumlah&#39;})<br>                     )<br>cov_jatim_pekanan [&#39;tahun&#39;] = cov_jatim_pekanan [&#39;tanggal&#39;].apply (lambda x : x.year)<br>cov_jatim_pekanan [&#39;pekan ke-&#39;] = cov_jatim_pekanan [&#39;tanggal&#39;].apply (lambda x : x.weekofyear)<br>cov_jatim_pekanan = cov_jatim_pekanan [[&#39;tahun&#39;,&#39;pekan ke-&#39;,&#39;jumlah&#39;]]<br>print (&#39;Info cov_jatim_pekanan :&#39;)<br>print (cov_jatim_pekanan.info())<br>print (&#39;\n Lima data teratas cov_jatim_pekanan :\n&#39;,cov_jatim_pekanan.head())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*ru2C9G_Rl860ztC58Aeljw.png" /></figure><p>Setelah melakukan inspeksi data<strong> cov_jatim_pekanan</strong> dimana jumlah kasus data dihitung setiap 7 hari, muncul pertanyaan lain bagaimana dengan pekan kemarin ?</p><p>Untuk menjawab hal tersebut akan dilakukan kalkulasi sederhana dengan tahapan berikut :</p><p>· Membuat kolom baru yang berisi jumlah kasus baru dalam satu pekan sebelumnya. Kolom ini diberi nama<strong> jumlah_pekanlalu</strong></p><p>· Mengganti nilai <strong>NaN</strong> pada kolom <strong>jumlah_pekanlalu</strong> dengan nilai <strong>0</strong></p><p>· Melakukan kompirasi antara kolom jumlah dengan kolom <strong>jumlah_pekanlalu</strong>. Hasil komparasi ini disimpan dalam kolom baru dengan nama <strong>lebih_baik</strong>, isinya adalah <strong>True</strong> apabila jumlah kasus baru pekan ini lebih rendah dibandingkan jumlah kasus pekan lalu.</p><p>Akan digunakan method shift () untuk membuat kolom <strong>jumlah_pekanlalu</strong>. Berikut source code lengkapnya dengan hasil outputnya.</p><pre>cov_jatim_pekanan [&#39;jumlah_pekanlalu&#39;] = cov_jatim_pekanan[&#39;jumlah&#39;].shift().replace (np.nan,0).astype (np.int)<br>cov_jatim_pekanan [&#39;lebih_baik&#39;] = cov_jatim_pekanan [&#39;jumlah&#39;] &lt; cov_jatim_pekanan [&#39;jumlah_pekanlalu&#39;]<br>print (&#39;Sepuluh data teratas : \n&#39;, cov_jatim_pekanan.head(10))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*Xp1u5E02QOdCkvVHwz5h1g.png" /></figure><p>Pada hasil output tersebut ditampilkan 10 data teratas pada data <strong>cov_jatim_pekanan</strong> yang telah ditambahkan kolom <strong>lebih_baik</strong>. Pada kolom tersebut terdapat<strong> True </strong>yang berarti jumlah kasus pada pekan ke-17 mengalami penurunan pada <strong>jumlah_pekanlalu</strong>. Untuk membandingkan keseluruhan data apakah terjadi penurunan atau tidak akan digunakan <strong>bar chart </strong>seperti berikut.</p><pre>plt.clf()<br>fig,ax = plt.subplots(figsize=(10,5))<br>ax.bar (data=cov_jatim_pekanan, x=&#39;pekan ke-&#39;, height=&#39;jumlah&#39;,<br>color = [&#39;mediumseagreen&#39; if x is True else &#39;salmon&#39; for x in cov_jatim_pekanan[&#39;lebih_baik&#39;]])<br>fig.suptitle (&#39;Kasus Pekanan Positif COVID-19 di Jawa Timur&#39;, y=1.00, fontsize=16, fontweight=&#39;bold&#39;, ha=&#39;center&#39;)<br>ax.set_title (&#39;Kolom hijau menunjukkan penambahan kasus baru lebih sedikit dibandingkan satu pekan sebelumnya&#39;, fontsize=12)<br>ax.set_xlabel(&#39;&#39;)<br>ax.set_ylabel(&#39;Jumlah kasus&#39;)<br>ax.text (1, -0.1, &#39;Sumber data : covid19.go.id&#39;,color=&#39;blue&#39;,ha=&#39;right&#39;, transform=ax.transAxes)</pre><pre>plt.grid(axis=&#39;y&#39;)<br>plt.tight_layout()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*482Q-y1Y9ixgPXqMPSfI9A.png" /></figure><p>Pada hasil output tersebut grafik berwarna hijau melambangkan jumlah kasus pada <strong>pekan ke-x</strong> mengalami penurunan dari jumlah kasus pekan lalu (<strong>jumlah_pekanlalu</strong>) atau pada kolom <strong>lebih_baik </strong>menghasilkan <strong>True</strong>.</p><p><strong>Pola dan Dinamika</strong></p><p>Ada yang akhirnya sembuh, namun tidak sedikit pula yang meninggal akibat COVID-19. Sementara itu penambahan kasus baru terus terjadi di masyarakat. Hal ini menimbulkan pertanyaan lain tentang “Hingga saat ini ada berapa kasus yang masih aktif ?”. Aktif dalam artian sedang dalam perawatan atau isolasi. Informasi ini sebenarnya telah disediakan di dalam respon API<strong> covid19.go.id</strong>. Namun, saya berinisiatif untuk menghitungnya sendiri. Jumlah kasus aktif dapat dihitung dengan cara mengurangi jumlah akumulasi positif dengan dengan jumlah akumulasi sembuh dan jumlah akumulasi meninggal. Akan digunakan method <strong>cumsum()</strong> untuk menghitung nilai akumulasi dari suatu vektor numerik seperti pada source code berikut.</p><pre>cov_jatim_akumulasi = cov_jatim_tidy[[&#39;tanggal&#39;]].copy()<br>cov_jatim_akumulasi [&#39;akumulasi_aktif&#39;] = (cov_jatim_tidy[&#39;kasus_baru&#39;]-cov_jatim_tidy[&#39;sembuh&#39;]-cov_jatim_tidy[&#39;meninggal&#39;]).cumsum()<br>cov_jatim_akumulasi [&#39;akumulasi_sembuh&#39;] = cov_jatim_tidy[&#39;sembuh&#39;].cumsum()<br>cov_jatim_akumulasi [&#39;akumulasi_meninggal&#39;] = cov_jatim_tidy [&#39;meninggal&#39;].cumsum()<br>print(cov_jatim_akumulasi.tail())</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*cUgr3T4SBHoMtvd8KLtb9g.png" /></figure><p>Output tersebut menampilkan data akumulasi dari 5 data terbawah. Sekarang akan dicoba dibuat visualisasi <strong>line chart </strong>dengan menggunakan <strong>plot</strong> pada<strong> ax.</strong></p><pre>plt.clf()<br>fig,ax = plt.subplots(figsize=(10,5))<br>ax.plot (&#39;tanggal&#39;,&#39;akumulasi_aktif&#39;,data=cov_jatim_akumulasi,lw=2)</pre><pre>ax.set_title(&#39;Akumlasi aktif COVID-19 di Jawa Timur&#39;,fontsize=22)<br>ax.set_xlabel(&#39;&#39;)<br>ax.set_ylabel(&#39;Akumulasi aktif&#39;)<br>ax.text(1,-0.1, &#39;Sumber data : covid19.go.id&#39;, color=&#39;blue&#39;, ha=&#39;right&#39;, transform=ax.transAxes)</pre><pre>ax.xaxis.set_major_locator(mdates.MonthLocator())<br>ax.xaxis.set_major_formatter(mdates.DateFormatter(&#39;%b %Y&#39;))</pre><pre>plt.grid()<br>plt.tight_layout()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*2WS-oqvXTNt3o_QYPr2tkg.png" /></figure><p>Pada hasil ouptput diatas menampilkan <strong>line chart</strong> pada kasus <strong>akumulasi_aktif</strong>. Menampilkan data akumulasi aktif pada akhir-akhir ini mengalami penambahan kasus. Lalu, berikut ini akan ditampilkan <strong>line chart</strong> dari data <strong>akumulasi_aktif</strong>, <strong>akumulasi_sembuh</strong> dan <strong>akumulasi_meninggal</strong>.</p><pre>plt.clf()<br>fig,ax = plt.subplots(figsize=(10,5))<br>cov_jatim_akumulasi.plot(x=&#39;tanggal&#39;, kind=&#39;line&#39;, ax=ax, lv=3, color=[&#39;salmon&#39;,&#39;slategrey&#39;,&#39;olivedrab&#39;])<br>ax.set_title(&#39;Dinamika kasus COVID-19 di Jawa Timur&#39;,fontsize=22)<br>ax.set_xlabel(&#39;&#39;)<br>ax.set_ylabel(&#39;Akumulasi aktif&#39;)<br>ax.text(1,-0.1,&#39;Sumber data : covid19.go.id&#39;,color=&#39;blue&#39;,ha=&#39;right&#39;,transform=ax.transAxes)</pre><pre>ax.xaxis.set_major_locator(mdates.MonthLocator())<br>ax.xaxis.set_major_formatter(mdates.DateFormatter(&#39;%b %Y&#39;))<br>plt.grid()<br>plt.tight_layout()<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*Y7OQHIgcfIe9sJB4txracA.png" /></figure><p>Output diatas menampilkan visualisasi data dari akumulasi_aktif, akumulasi_sembuh, dan akumulasi_meninggal, data tersebut menampilkan kenaikan dan penurunan dari suatu data. Okee ini merupakan penutup dari analisis data COVID-19. Sampai bertemu di artikel selanjutnya.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc9a1a257c64" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>