<?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 Dariga Kokenova on Medium]]></title>
        <description><![CDATA[Stories by Dariga Kokenova on Medium]]></description>
        <link>https://medium.com/@darigak?source=rss-b0ba9d5ded45------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Dariga Kokenova on Medium</title>
            <link>https://medium.com/@darigak?source=rss-b0ba9d5ded45------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 15:34:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@darigak/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[Intermediate guide to SQL]]></title>
            <link>https://darigak.medium.com/intermediate-guide-to-sql-58c8ee6116ad?source=rss-b0ba9d5ded45------2</link>
            <guid isPermaLink="false">https://medium.com/p/58c8ee6116ad</guid>
            <category><![CDATA[sql-queries]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[sqlite]]></category>
            <category><![CDATA[sql-questions]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Dariga Kokenova]]></dc:creator>
            <pubDate>Sun, 13 Jun 2021 03:34:26 GMT</pubDate>
            <atom:updated>2021-06-13T03:34:26.854Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s go back to the same SQL table we worked on within the <a href="https://darigak.medium.com/beginners-guide-to-sql-5e356b549433">beginner&#39;s guide to SQL</a>. The table can be downloaded <a href="https://www.w3resource.com/sql-exercises/soccer-database-exercise/soccer_team_view_data.php">here</a>, and we will call it soccer_team . You can copy-paste the table, save it as a .csv file, and then import it to a database in the SQL application. Let’s see what the table looks like. From the beginner’s guide to SQL, you know how to show all available columns from the table, but only show the first 10 rows.</p><pre>SELECT *<br>FROM soccer_team<br>LIMIT 10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vRppbOkrC2Q5lemi.png" /></figure><p><strong>Description of soccer_team table:</strong></p><ul><li><strong>team_id</strong> — ID for each team</li><li><strong>team_group</strong> — the name of the group in which the team belongs</li><li><strong>match_played</strong> — how many matches a team played in group stage</li><li><strong>won</strong> — how many matches a team won</li><li><strong>draw</strong> — how many matches a team draws</li><li><strong>lost</strong> — how many matches a team lost</li><li><strong>goal_for</strong> — how many goals a team conceded</li><li><strong>goal_agnst</strong> — how many goals a team scored</li><li><strong>goal_diff</strong> — the difference of goals scored and goals conceded</li><li><strong>points</strong> — how many points a team achieved from their group stage matches</li><li><strong>group_position</strong> — in which position a team finished their group stage matches</li></ul><p>In this article, let’s try to add more operations to the SQL queries.</p><p>First, let’s talk about the order of operations. Here’s the list you need to refer to when writing the SQL query:</p><pre>SELECT<br>FROM<br>WHERE<br>GROUP BY<br>HAVING<br>ORDER BY<br>LIMIT</pre><p>This order needs to be followed precisely. Otherwise, the query will not be executed. You are already familiar with some of the operations.</p><ul><li>SELECT asks to show the table’s columns.</li><li>FROM specifies which table you want to see.</li><li>WHERE is similar to using Filer in Excel. It can be used to look for certain values/text, specifying the boundaries of a range, etc.</li><li>LIMIT asks to only show the first X amount of rows.</li></ul><ol><li>Let’s start with the query that asks to show only certain columns (team_id, team_group, won, draw, lost) for teams that won 1 or more matches or draw 2 or more matches.</li></ol><pre>SELECT team_id, team_group, won, draw, lost<br>FROM soccer_team<br>WHERE won &gt; 0 OR draw &gt; 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*J0Si0bw5qJAtDfu5hPWCzA.png" /></figure><p>2. What if we didn’t want to see this information by individual teams and only wanted to see it by team groups? We can use a GROUP BY operator.</p><ul><li>GROUP BY summarizes information by requested column(s). You can find additional information about it <a href="https://www.w3schools.com/sql/sql_groupby.asp">here</a>.</li></ul><pre>SELECT team_group, won, draw, lost<br>FROM soccer_team<br>WHERE won &gt; 0 OR draw &gt; 1<br>GROUP BY team_group</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*K-bpopllTjoHAbOQP6IM1Q.png" /></figure><p>However, if you look closer, the last table doesn’t quite look right. The values in columns won, draw, lost should be higher. Also, if you compare the first row in tables #1 and #2, it is identical.</p><p>3. Here is the way to fix this issue, use SUM() operator.</p><pre>SELECT team_group, SUM(won), SUM(draw), SUM(lost)<br>FROM soccer_team<br>WHERE won &gt; 0 OR draw &gt; 1<br>GROUP BY team_group</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*ONilYaOQtVYjvlQlmh3IYA.png" /></figure><p>GROUP BY is often used with operators like SUM(), COUNT(), etc.</p><p>4. Now let’s say that we only want to see team groups with 4 or more winners, meaning SUM(won) is greater than 3. If we add this condition to WHERE statement to get WHERE won &gt; 0 OR draw &gt; 1 AND SUM(won) &gt; 3, we will get the following error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*O90MAXmmDio8TIMOPClTRQ.png" /></figure><p>This happens, because WHEREcannot be applied to aggregate operators. Aggregate operators have to be used with HAVING.</p><pre>SELECT team_group, SUM(won), SUM(draw), SUM(lost)<br>FROM soccer_team<br>WHERE won &gt; 0 OR draw &gt; 1<br>GROUP BY team_group<br>HAVING SUM(won) &gt; 3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*BsghNNL9_M8Id06DEl_mzg.png" /></figure><p>5. If we want to sort the results by how many matches were won in a group, we should apply ORDER BY. To sort from largest to smallest, use DESC. To sort from smallest to largest, use ASC.</p><pre>SELECT team_group, SUM(won), SUM(draw), SUM(lost)<br>FROM soccer_team<br>WHERE won &gt; 0 OR draw &gt; 1<br>GROUP BY team_group<br>HAVING SUM(won) &gt; 3<br>ORDER BY SUM(won) DESC</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*FvDLwXOxZ5TlwphMnEx4Cg.png" /></figure><p>6. Let’s add the remaining operator LIMIT.</p><pre>SELECT team_group, SUM(won), SUM(draw), SUM(lost)<br>FROM soccer_team<br>WHERE won &gt; 0 OR draw &gt; 1<br>GROUP BY team_group<br>HAVING SUM(won) &gt; 3<br>ORDER BY SUM(won) DESC<br>LIMIT 3</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*8bCyqd5U7m4ISjyzaGfpJg.png" /></figure><p>These are the main operators used in SQL and will be enough to write most of the queries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58c8ee6116ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginner’s guide to SQL]]></title>
            <link>https://darigak.medium.com/beginners-guide-to-sql-5e356b549433?source=rss-b0ba9d5ded45------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e356b549433</guid>
            <category><![CDATA[sqlite]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[sql-queries]]></category>
            <category><![CDATA[sql]]></category>
            <dc:creator><![CDATA[Dariga Kokenova]]></dc:creator>
            <pubDate>Sat, 05 Jun 2021 00:10:05 GMT</pubDate>
            <atom:updated>2021-06-05T00:17:54.964Z</atom:updated>
            <content:encoded><![CDATA[<p>If most of your work has been done in Excel so far, this article with the basic SQL queries is for you.</p><p>For the very beginners: SQL language lets you interact with a database. The database consists of tables. Each table has its own unique purpose. For example, if the database is used by an online store, it can have the following tables: listings table that has details of each listing sold by the store, order table, table with customer information, employees table, etc.</p><p>Why would a company use SQL, you might ask. Why not use Excel? It’s a perfectly adequate program, easy to use and understand. The answer is, Excel limits the total number of rows to 1,048,576. Meaning, if you’re creating a table in Excel you can’t insert more than that number of rows. However, Excel will become glitchy long before you hit that limit. If you need to sort, filter, add calculations to a worksheet, the program will slow down and might even crash. All your work will be lost. Generally, if your table has more than 30,000–50,000 rows, Excel’s computational power will lag.</p><p>For demonstration purposes, I’ll be referring to a table downloaded <a href="https://www.w3resource.com/sql-exercises/soccer-database-exercise/soccer_team_view_data.php">here</a>. You can copy-paste it and save it as a .csv file, then import it to a database in SQL application.</p><p>I’m making an assumption that you’re new to SQL and that you’ve been given read-only access (meaning you can’t add or delete rows from tables).</p><ol><li>Let’s say your manager told you to look for data and said that information can be found in a particular table named X. If you have never worked with this table before, you might want to review it first to get familiar with what you’re working with. To do that, let’s write a query to show all available information but only the first 10 rows.</li></ol><pre>SELECT *<br>FROM soccer_team<br>LIMIT 10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*POf3iOjr9_mVpnefzoT9jA.png" /><figcaption>The result of the SQL query above</figcaption></figure><ul><li>SELECT * means “show me all available columns”.</li><li>FROM specifies which table you want to see.</li><li>LIMIT 10 asks to only show the first 10 rows. You can change 10 to any number you want.</li></ul><p>It’s always helpful to know what kind of information is stored in the table. If you have some background knowledge, it will be easier for you to get oriented. In my experience, even if you’re proficient in SQL but don’t learn how data is structured, your knowledge is not beneficial. Even worse, you can write a query that will be executed, but the result could be wrong (not what you wanted to see). It’s always a good idea to perform some sanity checks, meaning review that the data you see is what you actually requested.</p><p>In this particular example, the table stores information about teams in a soccer tournament based on EURO CUP 2016.</p><p><strong>Description of soccer_team table:</strong></p><ul><li><strong>team_id</strong> — ID for each team</li><li><strong>team_group</strong> — the name of the group in which the team belongs</li><li><strong>match_played</strong> — how many matches a team played in group stage</li><li><strong>won</strong> — how many matches a team won</li><li><strong>draw</strong> — how many matches a team draws</li><li><strong>lost</strong> — how many matches a team lost</li><li><strong>goal_for</strong> — how many goals a team conceded</li><li><strong>goal_agnst</strong> — how many goals a team scored</li><li><strong>goal_diff</strong> — the difference of goals scored and goals conceded</li><li><strong>points</strong> — how many points a team achieved from their group stage matches</li><li><strong>group_position</strong> — in which position a team finished their group stage matches</li></ul><p>2. Now let’s add a condition to our query using WHERE. This is similar to using Filter in Excel.</p><pre>SELECT *<br>FROM soccer_team<br>WHERE team_group = &#39;A&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_JgpF3t1fnrwkif4FQIkXQ.png" /><figcaption>The result of the SQL query above</figcaption></figure><p>3. But what if we don’t want to see all available columns from the table, only the certain ones. To do that, we need to replace * in the SELECT line with the name of specific columns. Here is an example of how we might do that.</p><pre>SELECT team_id, won, draw, lost <br>FROM soccer_team<br>WHERE team_group = &#39;A&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*qSfipmMmFXO8GRpxmL5zTA.png" /><figcaption>The result of the SQL query above</figcaption></figure><p>4. We can add different conditions under WHERE. For example, we can use BETWEEN to specify the boundaries of a range. The range can be represented by numbers, text, or dates. Note that the boundaries of a range are included in the output.</p><pre>SELECT team_id, team_group, won, draw, lost <br>FROM soccer_team<br>WHERE team_group BETWEEN &#39;C&#39; AND &#39;D&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/470/1*u5EdICR6ZFRMNchb9wsJoQ.png" /><figcaption>The result of the SQL query above</figcaption></figure><p>5. We can also combine more than one condition by using AND and OR operators. Parenthesis can be added to show the order of operations, just like in math. In this example, we ask to only show teams from team group ‘A’ who either won 1+ games or draw 2+ games.</p><pre>SELECT team_id, team_group, won, draw, lost <br>FROM soccer_team<br>WHERE team_group = &#39;A&#39;  AND (won &gt; 0 OR draw &gt; 1)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*xcfQ50aMslYECzqRk4e5Zg.png" /><figcaption>The result of the SQL query above</figcaption></figure><p>Now let’s see what will happen if we don’t include parenthesis in the same query.</p><pre>SELECT team_id, team_group, won, draw, lost <br>FROM soccer_team<br>WHERE team_group = &#39;A&#39;  AND won &gt; 0 OR draw &gt; 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*2kRIXlzFPMAqPH3qv5IspA.png" /><figcaption>The result of the SQL query above</figcaption></figure><p>The result no longer includes just teams from group ‘A’. That’s because without the parenthesis OR operator no longer goes together with team_group = &#39;A&#39; condition.</p><p>There’s a lot more one can do in SQL, but these operators will let you get started quickly. Once you get the data you need from the table, you can copy-paste it into Excel to perform additional operations.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e356b549433" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Feature elimination examples for logistic regression]]></title>
            <link>https://darigak.medium.com/feature-elimination-examples-for-logistic-regression-7293462e197b?source=rss-b0ba9d5ded45------2</link>
            <guid isPermaLink="false">https://medium.com/p/7293462e197b</guid>
            <category><![CDATA[feature-selection]]></category>
            <category><![CDATA[logistic-regression]]></category>
            <category><![CDATA[decision-tree]]></category>
            <category><![CDATA[rfe]]></category>
            <category><![CDATA[sklearn]]></category>
            <dc:creator><![CDATA[Dariga Kokenova]]></dc:creator>
            <pubDate>Wed, 24 Feb 2021 19:14:46 GMT</pubDate>
            <atom:updated>2021-02-24T19:34:06.268Z</atom:updated>
            <content:encoded><![CDATA[<h3>Feature selection examples for logistic regression</h3><p>Let’s start with “Pump it Up: Data Mining the Water Table” dataset downloaded from <a href="https://www.drivendata.org/competitions/7/pump-it-up-data-mining-the-water-table/page/23/">drivendata.org</a>. Dataset includes training set values and a separate target variable called ‘status_group’. Training set contains 59,400 observations and 39 columns. Data was provided by Tanzanian Ministry of Water and nonprofit organization Taarifa to predict which waterpoints are functional or not. An accurate understanding of which waterpoints are non operational can improve maintenance and enhance access to clean water across the communities.</p><p>Below is a list of changes applied to the dataset:</p><ul><li>‘Status_group’ target variable has 3 possible outcomes: functional, functional needs repair and non functional. Change functional to 0 and functional needs repair + non functional to 1.</li><li>Fill NaN in ‘public_meeting’ and ‘permit’ with False.</li><li>Variable ‘construction_year’ is equal to 0 for about 20,000 observations. To fill 0, first remap ‘construction_year’ based on region mean and then based on overall ‘construction_year’ mean.</li><li>For variables ‘installer’, ‘funder’, ‘wpt_name’, ‘subvillage’, ‘lga’, ‘ward’, ‘scheme_name’: if value count is less than 200 or NaN, assign it to category other.</li><li>Drop column ‘date_recorded’.</li><li>Create dummy variables for non continuous variables.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/07e58e658a4f1f07d7bf5a53d34d0a58/href">https://medium.com/media/07e58e658a4f1f07d7bf5a53d34d0a58/href</a></iframe><p>After performing the steps above, we will have 59,400 observations and 382 columns. That is the dataset we will apply logistic regression to.</p><ol><li><strong>Logistic Regression</strong></li></ol><p>Let’s run a logistic regression on the dataset with 382 columns (features). Our output is 0 and 1. 0 means that the waterpoint is functional, and 1 means the waterpoint is non functional. The resulting metrics are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*UvOSso7D9BaocRsxc2fmHg.png" /></figure><ul><li>Accuracy: how often are we correct at predicting functional and non functional waterpoints? Accuracy = (True Positive + True Negative) / (all predictions)</li><li>Precision: when we predict the waterpoint to be non functional, how often is that prediction correct? Precision = True Positive / (True Positive + False Positive)</li><li>Recall (Sensitivity): what proportion of truly non functional waterpoints was identified correctly? Recall (Sensitivity) = True Positive / (True Positive + False Negative)</li><li>F1 score: harmonic average of precision and recall metrics. F1 score = (2 * Precision * Recall) / (Precision + Recall)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*LVN7pK5lBiPAq4KbbleK0A.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/280113512997dcbc6e105be624eeffb2/href">https://medium.com/media/280113512997dcbc6e105be624eeffb2/href</a></iframe><p>2. <strong>Applying Recursive Feature Elimination (RFE)</strong></p><p>A general rule of thumb is to use as many features as a square root of the number of observations. For this particular example, we need to take a square root of 59,400, which is approximately equal to 243.7. However, we have 382 features (columns) in our dataset. Let’s try to narrow it down to 250 features using sklearn.feature_selection.RFE.</p><p>Feature selection methods, such as RFE, reduce overfitting and improve accuracy of the model. Below are the metrics for logistic regression after RFE application, and you can see that all metrics have increased.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*OPNs0449wlF5bGaKHqy2MA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*ODPvk5Uvr4K3RoPMq0upqg.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3400045a6c78339e93ed34af422253fc/href">https://medium.com/media/3400045a6c78339e93ed34af422253fc/href</a></iframe><p>3. <strong>Applying SelectFromModel (SFM)</strong></p><p>Another way to determine feature importance is sklearn.feature_selection.SelectFromModel. We will need to specify that we want max_features=250 and threshold=-np.inf. Otherwise, we can specify threshold, and SFM will determine how many features meet that requirement. The resulting metrics are higher than logistic regression without feature selection, but slightly lower than logistic regression with RFE.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*Hi4SxaXjcBYiiUEqZ8jASQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*gVJ2mqWvcjiSEkjC1KNwNg.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d57c2044ecdba2b37c0386c63c36ea9/href">https://medium.com/media/4d57c2044ecdba2b37c0386c63c36ea9/href</a></iframe><p>4. <strong>Applying SequentialFeatureSelector (SFS)</strong></p><p>We can also apply sklearn.feature_selection.SequentialFeatureSelector to the dataset. SFS adds (forward selection) or removes (backward selection) features to the feature subset. However, SFS is significantly slower than SFM due to its iterative process and cv scoring. Narrowing down the number of features from 382 to 250 was taking too long, and that process had to be cancelled. However, below is the code for SFS with 5 features to select and the resulting metrics. Please note that this is just an example to demonstrate how SFS is used and not recommended to be applied to large datasets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*8BCEw6rBY-n_luXl89hkBQ.png" /></figure><p>Note: the lower left corner in the confusion matrix below is 1,925.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*59t48lvXwJjpKdwyEeNKog.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/366fe08b3f7b5bcfba6e073d0426a0ac/href">https://medium.com/media/366fe08b3f7b5bcfba6e073d0426a0ac/href</a></iframe><p>So far, logistic regression with RFE feature selection produces the best metrics. However, if we try decision tree with max_depth=20, the resulting metrics and confusion matrix are much better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*m__G1EJKGX60jLYMzJMSJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*0P38hFE8E0lkATqyPI5X2Q.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d06470e82fca06a46e15d8b33a956f0a/href">https://medium.com/media/d06470e82fca06a46e15d8b33a956f0a/href</a></iframe><p>To conclude, applying feature selection methods to logistic regression will improve the accuracy of the model but other models, such as decision tree, might be even better for improving accuracy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7293462e197b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your guide to folium markers]]></title>
            <link>https://darigak.medium.com/your-guide-to-folium-markers-b9324fc7d65d?source=rss-b0ba9d5ded45------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9324fc7d65d</guid>
            <category><![CDATA[icons]]></category>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[folium]]></category>
            <category><![CDATA[marker]]></category>
            <category><![CDATA[mapping]]></category>
            <dc:creator><![CDATA[Dariga Kokenova]]></dc:creator>
            <pubDate>Tue, 09 Feb 2021 00:47:01 GMT</pubDate>
            <atom:updated>2021-02-09T00:47:01.959Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s start with Vehicle Collisions in NYC dataset from <a href="https://www.kaggle.com/nypd/vehicle-collisions?select=database.csv">kaggle</a> and limit it to 2015 data only (the steps are listed <a href="https://darigak.medium.com/brief-introduction-to-pandas-and-folium-be02568075c4?source=friends_link&amp;sk=0389842711572f89e0aead44e82dd1d3">here</a>).</p><p>We will work with <strong>df_2015</strong> dataset, which was created using code below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5238fc603b9902ec8e96be267ac1864d/href">https://medium.com/media/5238fc603b9902ec8e96be267ac1864d/href</a></iframe><p>It is very easy to start working in folium. Just google location’s latitude/longitude and paste it into <strong>folium.Map(location=[…, …])</strong>. The result will be an interactive map that looks like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8spFoZsKjeU38M1pcl6omg.png" /><figcaption>The output of running <strong>folium.Map(location=[40.730610, -73.935242])</strong></figcaption></figure><p>If the map needs to be smaller, it can be adjusted with <strong>Figure</strong> from <strong>branca.element</strong>. We can also specify what zoom level we want to start with and zoom min and max levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wKBJqvIeGs5cmNebhdE4jQ.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d3584e6b04c69667d7d1961f681d7c50/href">https://medium.com/media/d3584e6b04c69667d7d1961f681d7c50/href</a></iframe><p>We can also adjust the map size with width, height, left and top arguments, but it will leave the white space around the map like in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SonjJCTbGYNjo0XN-XWFow.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/72c2bf726d519e7b08f33c5b5f847878/href">https://medium.com/media/72c2bf726d519e7b08f33c5b5f847878/href</a></iframe><p>We can change how the map looks by using <strong>folium.TileLayer</strong> or <strong>tiles</strong>. The default setting is OpenStreetMap, but other Stamen Terrain, Stamen Toner, Stamen Water Color, cartodbpositron and cartodbdark_matter tiles are available. Stamen Terrain and OpenStreetMap are my favorite tiles.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FsBB9tk2GVxg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DsBB9tk2GVxg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FsBB9tk2GVxg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f867fdd8c0d4b1cc629589c4bd1ed42/href">https://medium.com/media/3f867fdd8c0d4b1cc629589c4bd1ed42/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a97163e470bc24955ed8cd4c2f30f19f/href">https://medium.com/media/a97163e470bc24955ed8cd4c2f30f19f/href</a></iframe><p>Let’s try adding markers to the map. Set up variables max_PEDESTRIANS_INJURED, max_CYCLISTS_INJURED and max_MOTORISTS_INJURED equal to pandas dataframe with max persons injured in a given category.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ee0cc5076151c5ed11a1da0abb9db84/href">https://medium.com/media/0ee0cc5076151c5ed11a1da0abb9db84/href</a></iframe><p>We will then pass latitude and longitude to <strong>folium.Marker</strong> to show the location on the map. The output of max_CYCLISTS_INJURED has two rows and we will need to identify them by index.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OT_j_-_GYihpeyVVuXkbwg.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/90589dbefdcfa2e2d8fdb7c39544108e/href">https://medium.com/media/90589dbefdcfa2e2d8fdb7c39544108e/href</a></iframe><p>It’s difficult to see the difference between the markers, so let’s add <strong>icon=folium.Icon</strong> to markers and specify icon’s color and display. Location of an accident with max pedestrians injured has red icon, locations with max cyclists injured have green icon, and location of an accident with max motorists injured has blue icon.</p><p>Available icon colors are: ‘red’, ‘blue’, ‘green’, ‘purple’, ‘orange’, ‘darkred’, ‘lightred’, ‘beige’, ‘darkblue’, ‘darkgreen’, ‘cadetblue’, ‘darkpurple’, ‘white’, ‘pink’, ‘lightblue’, ‘lightgreen’, ‘gray’, ‘black’, ‘lightgray’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-mQFE-HenVxZg6ig3LK07Q.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0ed1e06bb23e9bd105a12c7b047da077/href">https://medium.com/media/0ed1e06bb23e9bd105a12c7b047da077/href</a></iframe><p>These icons are good enough, but I’d like to change them to something more meaningful. For example, i want a bicycle icon for accidents involving cyclists. By default, icons are glyphicon from bootstrap, and their full list can be found <a href="https://getbootstrap.com/docs/3.3/components/">here</a>. Glyphicons are useful, but limited in range. To get more variety, we can use icons from font-awesome. The list of font-awesome icons is <a href="https://fontawesome.com/v4.7.0/icons/">here</a>. To use font-awesome icons, we need to specify <strong>prefix=‘fa’</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7D2PgEfa1WDcCc5W12UyUw.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53e33b76e6850ae86b411b69f39a2b38/href">https://medium.com/media/53e33b76e6850ae86b411b69f39a2b38/href</a></iframe><p>Additionally, we can add <strong>tooltip</strong> and <strong>popup</strong>. Tooltip allows to display a text when hovering over the marker. Popup is a label for the marker that is visible after the marker is clicked on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JKMKo8_XAHRXJGhjo7HWKA.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f22ac8948f025d760eb54895861622b/href">https://medium.com/media/8f22ac8948f025d760eb54895861622b/href</a></iframe><p>Now let’s add more information to the popup about how many people were injured in any given category and how many people were injured overall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g0NkRZETq1Wp4rg7gLljLg.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c486153eace254603f97e68408d0be5f/href">https://medium.com/media/c486153eace254603f97e68408d0be5f/href</a></iframe><p>At last, let’s add <strong>folium.LatLngPopup()</strong> so we can get latitude/longitude information by clicking anywhere on the map.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbgyE4xqVkAp_m-mWETm9w.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f90de7ccbc8a6fa06ac4221e6d3c1621/href">https://medium.com/media/f90de7ccbc8a6fa06ac4221e6d3c1621/href</a></iframe><p>Now, our map is complete!</p><p><strong>Additional resources:</strong></p><ol><li><a href="https://www.analyticsvidhya.com/blog/2020/06/guide-geospatial-analysis-folium-python/"><em>Your Guide to Getting Started with Geospatial Analysis using Folium (with multiple case studies)</em></a></li><li><a href="https://python-visualization.github.io/folium/quickstart.html#Getting-Started"><em>Quickstart</em></a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9324fc7d65d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brief introduction to pandas and folium]]></title>
            <link>https://darigak.medium.com/brief-introduction-to-pandas-and-folium-be02568075c4?source=rss-b0ba9d5ded45------2</link>
            <guid isPermaLink="false">https://medium.com/p/be02568075c4</guid>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[folium]]></category>
            <category><![CDATA[pandas-dataframe]]></category>
            <category><![CDATA[python-pandas]]></category>
            <dc:creator><![CDATA[Dariga Kokenova]]></dc:creator>
            <pubDate>Tue, 26 Jan 2021 15:39:31 GMT</pubDate>
            <atom:updated>2021-01-26T15:39:31.034Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s download Vehicle Collisions in NYC dataset from <a href="https://www.kaggle.com/nypd/vehicle-collisions?select=database.csv">kaggle</a>. This data was collected by the NYPD and published by NYC OpenData. After downloading database.csv file, place it in the same folder as the jupyter notebook you want to work in.</p><p>To begin with, we will need to import <strong><em>pandas</em></strong> (to work with csv file), <strong><em>folium</em></strong> (to show locations on the map) and <strong><em>datetime</em></strong> (to convert data information into MM/DD/YYYY format). Then we will create a variable <strong><em>df</em></strong> (short for dataframe) and read the database.csv file into it. Implementing <strong><em>df.shape</em></strong> will give us a general overview of how much information we have. In this particular case, we have 477,732 rows and 29 columns. That’s a lot of data! Let’s take our time looking around.</p><p>Use <strong><em>df.columns</em></strong> to see a list of the column names. The vehicle collision dataset includes the following information:</p><ul><li>&#39;UNIQUE KEY&#39; to identify each collision;</li><li>&#39;DATE&#39; and &#39;TIME&#39; of the collision;</li><li>Information about the location: &#39;BOROUGH&#39;, &#39;ZIP CODE&#39;, &#39;LATITUDE&#39;, &#39;LONGITUDE&#39;, &#39;LOCATION&#39;, &#39;ON STREET NAME&#39;, &#39;CROSS STREET NAME&#39;, &#39;OFF STREET NAME&#39;;</li><li>Information about who was injured: &#39;PERSONS INJURED&#39;, &#39;PERSONS KILLED&#39;, &#39;PEDESTRIANS INJURED&#39;, &#39;PEDESTRIANS KILLED&#39;, &#39;CYCLISTS INJURED&#39;, &#39;CYCLISTS KILLED&#39;, &#39;MOTORISTS INJURED&#39;, &#39;MOTORISTS KILLED&#39;;</li><li>Information about vehicles involved: &#39;VEHICLE 1 TYPE&#39;, &#39;VEHICLE 2 TYPE&#39;, &#39;VEHICLE 3 TYPE&#39;, &#39;VEHICLE 4 TYPE&#39;, &#39;VEHICLE 5 TYPE&#39;, &#39;VEHICLE 1 FACTOR&#39;, &#39;VEHICLE 2 FACTOR&#39;, &#39;VEHICLE 3 FACTOR&#39;, &#39;VEHICLE 4 FACTOR&#39;, &#39;VEHICLE 5 FACTOR&#39;.</li></ul><p>To see a sample of the data, use <strong><em>df.head(10)</em></strong> . The number 10 specifies the number of rows shown. If not specified, only 5 rows will be seen, and the maximum number of rows is 50. Additionally, only the first 10 and the last 10 columns will be shown by default. To see all columns, run <strong><em>pd.set_option(‘display.max_columns’, None).</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DNTAaWlUrL17d83aslS2_w.png" /><figcaption>This is the output of running df.head(10)</figcaption></figure><p><strong><em>df.describe()</em></strong> provides statistical information by column: count of items in a column, column mean, standard deviation, min, 25/50/75 percentile and max values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zQ2P9E6WDnkZjZiBaCnkLw.png" /><figcaption>This is the output of running <strong><em>df.describe()</em></strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*2Wr9xkuzUq8w4JgcrKwyeA.png" /><figcaption>This is the output of running df.isna().sum()</figcaption></figure><p>While working with pandas dataset, it’s always a good idea to check for NaN (stands for not a number) values using <strong><em>df.isna().sum()</em></strong> or <strong><em>df.isna().mean()</em></strong>.</p><p>Because we want to show the accident location on the map, we need latitude and longitude information; however, that information is missing for 121,132 rows. One way to deal with that is to remove those rows using <strong><em>df.dropna(subset = [‘LATITUDE’], inplace = True)</em></strong>. Now if we run <strong><em>df.shape</em></strong>, the output is 356,600 rows and 29 columns.</p><p>Let’s run <strong><em>df.head(10)</em></strong> again and see what changed. Row #4 used to have NaN value in LATITUDE column and was removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lxYJ-YMCIFZmFen61JjtfA.png" /><figcaption>This is the output of running df.head(10)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*uNRUNwtRNqH_Ce9X0dEPSg.png" /><figcaption>This is the output of running df[‘DATE’]</figcaption></figure><p>Next, let’s review DATE column. <strong><em>df[‘DATE’]</em></strong> will give us a brief view of the column. We can see right away that it has information for 2015–2017 years.</p><p><strong><em>df[‘DATE’][0]</em></strong> will return ‘01/01/2015’, the first row in the column.</p><p>And <strong><em>type(df[‘DATE’][0]) </em></strong>returns string, meaning 01/01/2015 is not actually written in the date format. Let’s change that by creating a new column <strong><em>df[‘DATE_formatted’] = pd.to_datetime(df[‘DATE’])</em></strong>. Now <strong><em>type(df[‘DATE_formatted’][0])</em></strong> returns <em>pandas._libs.tslibs.timestamps.Timestamp</em>.</p><p>We can also create a new column containing only YEAR information by using <strong><em>df[‘DATE_YEAR’] = df[‘DATE_formatted’].dt.year</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*Kf-QGEBO2V4S7ts43sq5zg.png" /><figcaption>This is the output of running df[‘DATE_YEAR’].value_counts()</figcaption></figure><p>Let’s see the breakdown of rows by year using <strong><em>df[‘DATE_YEAR’].value_counts()</em></strong></p><p>That’s too much information for our purpose, so we can change it by removing years other than 2015. Let’s create a new dataset only for 2015 information: <strong><em>df_2015 = df[df[‘DATE_YEAR’] == 2015].</em></strong> Running <strong><em>df_2015.shape</em></strong> shows us that we have 182,845 rows and 31 columns now.</p><p>The code for information above is:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5238fc603b9902ec8e96be267ac1864d/href">https://medium.com/media/5238fc603b9902ec8e96be267ac1864d/href</a></iframe><p>Now we can show the information for 2015 accidents in NYC on the map. Let’s start with showing one location. Googling NYC location gives us 40.730610 latitude and -73.935242 longitude that we can add to <strong><em>folium.Map</em></strong> function. Then we can add a marker to it with radius = 1. The default color for the marker is blue; you can see it in Queens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CHpWj3BULv1I98IZZ5bNCQ.png" /><figcaption>The output of the code below</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/46daa86bd1bae60cad85da257c48b21e/href">https://medium.com/media/46daa86bd1bae60cad85da257c48b21e/href</a></iframe><p>Now, let’s show location of all accidents on the map. Take PERSONS INJURED column and plot green markers for 0 people injured and red markers for more than 0 people injured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_EUwkRz9HD2fwJoq8yHjTg.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32922c35de5a1b71719eb9c630bb23d6/href">https://medium.com/media/32922c35de5a1b71719eb9c630bb23d6/href</a></iframe><p>Well the previous map didn’t look pretty, but keep in mind that it showed all accidents that have happened in 2015 calendar year. The good think about folium library is that it’s interactive, and we can zoom in and out of it as if it was a regular map application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yri043XwXok3ix4kk4eDMw.png" /><figcaption>Zoomed in view of the previous map</figcaption></figure><p>As another example, we can show accidents involving cyclists on the map. Blue dots show where 1 cyclist was injured, and orange dots show where more than 1 cyclists were injured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-3LrQlNTr4cbEqDnViQrw.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3cf33553739d934ee271f6b518d8b965/href">https://medium.com/media/3cf33553739d934ee271f6b518d8b965/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kv0irgoePwpQa8UoOzUGxQ.png" /><figcaption>Zoomed in view of the previous map</figcaption></figure><p>That was a brief over view of pandas dataset and folium map. If you would like to look further into visualizing geospacial data, geopandas and geoplot libraries can be used.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be02568075c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 variations of scatter plot visualization]]></title>
            <link>https://darigak.medium.com/7-variations-of-scatter-plot-visualization-9ea1fa523016?source=rss-b0ba9d5ded45------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ea1fa523016</guid>
            <category><![CDATA[scatter-plots]]></category>
            <category><![CDATA[seaborn]]></category>
            <category><![CDATA[iris-dataset]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[matplotlib]]></category>
            <dc:creator><![CDATA[Dariga Kokenova]]></dc:creator>
            <pubDate>Mon, 11 Jan 2021 03:44:56 GMT</pubDate>
            <atom:updated>2021-01-12T15:12:13.306Z</atom:updated>
            <content:encoded><![CDATA[<p>I was interested in different ways scatter plot visualization can be used. To demonstrate it, I chose the ‘iris’ dataset familiar to most working with Python. This dataset contains information about sepal length and width, and petal length and width for 3 species of irises (setosa, versicolor and virginica).</p><p>1) Let’s create a matplotlib version of the scatter plot for all 150 observations. The horizontal axis represents sepal width, and the vertical axis represents sepal length . The resulting chart seems chaotic and doesn’t provide much explanation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*jOvztW1yMPTSqE7YBWZZ0g.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/013d568a509f524c629da047d3c344e2/href">https://medium.com/media/013d568a509f524c629da047d3c344e2/href</a></iframe><p>2) However, we know that the dataset contains information about 3 different species of irises. Let’s separate them from each other and assign different colors to setosa, versicolor and virginica species. It’s easy to see now how their measurements differ. For example, Iris setosa sepals are wide and short, while Iris versicor sepals are narrower and longer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XjMBORzzOxy_vC2KpncgfQ.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6bdb10a8e28e34a59b481db6f40dfa3d/href">https://medium.com/media/6bdb10a8e28e34a59b481db6f40dfa3d/href</a></iframe><p>3) Now let’s recreate the same chart using seaborn. Seaborn library is preferred when you want to create pretty charts; in particular, I like to set style to “dark” and set context to “talk” options. However, there are some additional features that are not available in matplotlib that we will explore later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mvoV-YtoCvoB-i_B3AilQ.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ba8a1987e0c66ef746777c4c3834fc4/href">https://medium.com/media/3ba8a1987e0c66ef746777c4c3834fc4/href</a></iframe><p>4) Now, that’s too many lines of code. Let’s try to use something simpler. We will use the same sns.scatterplot function but will add hue = ‘species’ that will help us differentiate between Iris setosa, Iris versicolor and Iris virginica. Additionally, palette = [‘b’, ‘r’, ‘g’] specifies the order of colors we want to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ndxlBXPzzd-5JaKRBljcw.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d75430dedb3e6b6ac88f260f3df3075/href">https://medium.com/media/1d75430dedb3e6b6ac88f260f3df3075/href</a></iframe><p>5) In addition to differentiating by species, we can add one more argument to the scatter plot, size. In this particular example, I added size = ‘petal_length’ that adjusts the size of the markers depending on the petal length. The smaller the petal length, the smaller the marker size and vice-versa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1W-vhC-joEQOJbB0qBql8g.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/31c34d76affe7fc3dac8a1cfbb676114/href">https://medium.com/media/31c34d76affe7fc3dac8a1cfbb676114/href</a></iframe><p>6) But what if you want to separate charts like we did in examples 2 and 3? Then we can use sns.FacetGrid function and specify that we want to separate into columns by species values (col = ‘species’). Documentation on sns.FacetGrid can be found <a href="https://seaborn.pydata.org/generated/seaborn.FacetGrid.html">here</a> .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kv37tBTKFq3S6Cbi-L2TLA.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dbe043e84580a35d696ba73dfbf32f1c/href">https://medium.com/media/dbe043e84580a35d696ba73dfbf32f1c/href</a></iframe><p>7) Lastly, we can make our chart dynamic using CheckButtons from matplotlib.widgets. We will also need to utilize “%matplotlib notebook” line, as the output will remain static without it. I relied on the check buttons documentation <a href="https://matplotlib.org/3.3.1/gallery/widgets/check_buttons.html#sphx-glr-gallery-widgets-check-buttons-py">here</a> to create the latest chart.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FaHsVek-rS8A%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DaHsVek-rS8A&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FaHsVek-rS8A%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5aa939b5783c51c356f39bf8e2b125c3/href">https://medium.com/media/5aa939b5783c51c356f39bf8e2b125c3/href</a></iframe><p>The code for check buttons is fairly long, but the result may be well worth it. It lets you inspect the markers separately by species and combined all together.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7deb57babb85e2d428937c963ba24210/href">https://medium.com/media/7deb57babb85e2d428937c963ba24210/href</a></iframe><p>I have to admit, the chart with check buttons is my favorite because of how good it looks, but the sixth chart (created using FacetGrid) is probably the easiest to use with minimal code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ea1fa523016" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>