<?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[Lintang Gilang - Medium]]></title>
        <description><![CDATA[Lintang Gilang - Medium]]></description>
        <link>https://medium.com/belajar-nulis?source=rss----278800007f59---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Lintang Gilang - Medium</title>
            <link>https://medium.com/belajar-nulis?source=rss----278800007f59---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 00:32:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/belajar-nulis" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[This Pandas skill will get you a job]]></title>
            <link>https://medium.com/belajar-nulis/this-pandas-skill-will-get-you-a-job-55bebfec3e7e?source=rss----278800007f59---4</link>
            <guid isPermaLink="false">https://medium.com/p/55bebfec3e7e</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[get-jobs]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Lintang Gilang Pratama]]></dc:creator>
            <pubDate>Thu, 17 Nov 2022 15:58:01 GMT</pubDate>
            <atom:updated>2022-11-17T15:58:01.553Z</atom:updated>
            <content:encoded><![CDATA[<h3>This Pandas skill will get you a job !!!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3SwzbI62lOY7cDtq" /><figcaption>Photo by <a href="https://unsplash.com/@hiteshchoudhary?utm_source=medium&amp;utm_medium=referral">Hitesh Choudhary</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>A data practitioner really needs to master various skills to complete the data analysis process effectively and efficiently. For this, various tools are needed with their respective functions. One of the tools most frequently used by data practitioners is Pandas, which is used in the Python programming language.</blockquote><h3>1. What is Pandas ?</h3><p>what is pandas? Pandas is an open source and licensed Python library which is often used by data analysts and data scientists when exploring data. Pandas is used to create tables, modify dimension data, inspect data, and so on. The basic data structure in Pandas is named DataFrame, which makes it easier for us to read files with many types of formats such as .txt, .csv, and .tsv files. This feature will create tables and can also process data using operations such as join, different, group by, aggregation, and other techniques found in SQL.</p><p>A data practitioner really needs to master various skills to complete the data analysis process effectively and efficiently. For this, various tools are needed with their respective functions. One of the tools most frequently used by data practitioners is Pandas, which is used in the Python programming language. Pandas is based on another package called Numpy, which supports multidimensional arrays.</p><p>The Pandas library has two types of data structures for the latest version :<br>1. Series<br>2. Data Frame</p><p>What is Series? Series is like a one-dimensional array as well as a numpy array. Pandas series have indexes and we can control the index of each of those elements.</p><p>What is a Data frame? A data frame is a two-dimensional array with rows and columns. This data structure is the most standard way to store data in the form of tables/tabular data.</p><h3>2. Import Pandas</h3><p>If you’re going to use pandas, then you need to make sure it is included in your python environment. The way you do think is by importing pandas.</p><p>Importing pandas means bringing all of the pandas functionality to your finger tips in your python script or jupyter notebook. For best practice using pandas, we can also import numpy.</p><pre>import pandas as pd<br>import numpy as np</pre><p>Let’s break down what this statement means.</p><p>What does import pandas as pd mean?</p><ul><li>Import = Bring this functionality or library to my python script</li><li>Pandas = The library you want to import, in this case, it’s pandas</li><li>As = The python nomenclature for creating as alias. This is a fancy way of taking a long word and referencing it as a short word</li><li>pd = The standard short name for referencing pandas</li></ul><h3>3. Try Data Frames</h3><p>A DataFrame in Pandas is a 2-dimensional, labeled data structure which is similar to a SQL Table or a spreadsheet with columns and rows. Each column of a DataFrame can contain different data types.</p><p>To better understand what’s in the Pandas library, we start by creating a dictionary in python.</p><pre>cars = {<br>  &#39;Brand&#39;: [&#39;Brio&#39;, &#39;Jazz&#39;, &#39;HRV&#39;, &#39;CRV&#39;, &#39;Civic&#39;, &#39;Mobilio&#39;, &#39;BRV&#39;, &#39;City&#39;],<br>  &#39;Price&#39;: [148, 265, 364, 515, 586, 217, 281, 333],<br>  &#39;Status&#39; : [&#39;sold&#39;,&#39;sold&#39;,&#39;unsold&#39;,&#39;sold&#39;,&#39;unsold&#39;,&#39;unsold&#39;,&#39;sold&#39;,&#39;unsold&#39;],<br>  &#39;ProdYear&#39; : [2020, 2019, 2021, 2020, 2022, 2021, 2023, 2022]<br>}</pre><p>This dummy data — used car sales. Let’s convert the dictionary above into a pandas dataframe.</p><p>The dataframe in pandas is usually referred to as df</p><pre>df = pd.DataFrame(cars)</pre><h3>4. Head and Tail</h3><pre>df.head()</pre><p>used to display the top n data</p><pre>df.head(n)</pre><p>used to display the top n data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*EHwXZUD-UvISbmLAg1DRUg.png" /></figure><h3>Tail</h3><pre>df.tail()</pre><p>used to display the last 5 data</p><pre>df.tail(n)</pre><p>used to display the top last n data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*t_-a9X4iSoJ1kqBYEvpm4g.png" /></figure><h3>5. Slicing</h3><p>The indexing and attribute selection operators are great because they work just like they do in the rest of the Python ecosystem. If you are a beginner, this makes it easy to pick up and use. However, pandas has its own access operators, loc and iloc.</p><p>df.iloc[ row , column] → Index-based selection</p><p>This method is used when the index label of a data frame is something other than numeric series of 0, 1, 2, 3….n or in case the user doesn’t know the index label.</p><pre>df.iloc[:,:]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*Rxz5GG2Y2GnJLkNFkgfJcA.png" /></figure><pre>df.iloc[0:7,:]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*ffWmcr7pUf_vaie1F1CARQ.png" /></figure><pre>df.iloc[0:7,1:2]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*nJ5ma1gG2a6fvYNTif144Q.png" /></figure><p>df.loc[ row , column] → Label-based selection</p><p>Attribute access a group of rows and columns by label(s) or a boolean array in the given DataFrame.</p><pre>df.loc[:,:]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*I9rjZvFMgZ5-pKHaRPOcgw.png" /></figure><pre>df.loc[0:7,:]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*bu3FahUkD4Gpb81JMmS8TQ.png" /></figure><pre>df.loc[0:7,&#39;Price&#39;:&#39;Price&#39;]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*_29t1Wr5CodEuzz9OvrEzg.png" /></figure><h3>6. Conditional selection</h3><p>Another way of slicing is doing conditional filtering. For example, filter data with prices below 400 or sold status.</p><p>In SQL it’s called “where clause” and in excel it’s called “filtering table”.</p><p>df[ conditional_1 , (and/or), conditional_2, ... ]</p><pre>df[df.Price &lt;= 400]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*WEvqGkhEoZU31AwU8cU2iQ.png" /></figure><pre>df[df.Status == &#39;sold&#39;]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*aHSNp0yR0jKkAQ7ESDLe8g.png" /></figure><pre>df[(df.Price &gt;= 400) &amp; (df.Status == &#39;unsold&#39;)]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*Obsv-mNs7I7ujGCk2u9BGw.png" /></figure><pre>df[(df.Price &gt;= 400) | (df.Status == &#39;unsold&#39;)]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*QH8uC_qpu0cGkuJ3CnRHhw.png" /></figure><h3>7. Descriptive Statistics</h3><p>Descriptive statistics are a way of describing the features of a data set by producing summaries about a sample of the data. This is often described as a displayed summary of the data that describes the contents of the data. For example in the price column.</p><p>describe() Function gives the mean, std and IQR values. It excludes character column and calculate summary statistics only for numeric columns.</p><p>You can do a summary for all data or only part of it.</p><pre>df.describe()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*F62pHFxNEGXDE6gJxLsxtg.png" /></figure><p>You can do a summary for all the data or just some of it. If only part of it then call the column name like this.</p><pre>df.Price.count()<br>df.Price.mean()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*Uc7Xocl9NQKpzUSoQxnOPA.png" /></figure><p>This is a list of explanations for each output of the description function</p><ol><li>DataFrame.count → Count number of non-NA/null observations.</li><li>DataFrame.max → Maximum of the values in the object.</li><li>DataFrame.min → Minimum of the values in the object.</li><li>DataFrame.mean → Mean of the values.</li><li>DataFrame.std → Standard deviation of the observations.</li><li>DataFrame.select_dtypes → Columns based on their dtype.</li></ol><h3>8. Case Expression</h3><p>If you are familiar with case expressions in SQL or if-else in excel then pandas can also make the same thing by combining it with a lambda.</p><p>What is the case expression? CASE expressions are conditionals that pass conditions and return the value when the first condition is met (like an if-then-else statement). So once a condition is true, it will stop reading and return the result.</p><p>If none of the conditions are true, it returns the value in the ELSE clause.</p><p>If there is no ELSE section and neither condition is true, it returns NULL.</p><pre>def fun(x):<br>    if x &lt; 200:<br>        return &quot;Low&quot;<br>  <br>    elif x &gt;= 200 and x&lt;400:<br>        return &quot;Normal&quot;<br>  <br>    else:<br>        return &quot;High&quot;<br>    <br>df[&#39;type_price&#39;] = df[&#39;Price&#39;].apply(lambda x : fun(x))<br><br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*wBBWdbokdrlnxIw8i6gKAg.png" /></figure><h3>9. Grouping and Sorting</h3><p>The GROUP BY statement groups rows that have the same values into summary rows, like &quot;find the number of type_price in each production year&quot;.</p><p>The GROUP BY statement is often used with aggregate functions (COUNT(), MAX(), MIN(), SUM(), AVG()) to group the result-set by one or more columns.</p><p>In SQL it’s called “group by” and in excel it’s called “pivot table”.</p><pre># Make a summary of car sales data sold<br><br>df.groupby([&#39;Status&#39;]).agg({&#39;Status&#39;:&#39;count&#39;})</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*Eg8mxwt6xoryNkqxipJ5jg.png" /></figure><pre># Add previous data with average sales<br><br>df.groupby([&#39;Status&#39;]).agg({&#39;Status&#39;: &#39;count&#39;, <br>                             &#39;Price&#39;: &#39;mean&#39;})</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*bdgRpQV2yHKsF-qjYvIxeA.png" /></figure><pre># Add previous data with max and min sales<br><br>df.groupby([&#39;Status&#39;]).agg({&#39;Status&#39;: &#39;count&#39;,<br>                             &#39;Price&#39;: [&#39;mean&#39;,&#39;max&#39;,&#39;min&#39;]})</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*MbAKwJ-9XJB4N8RPu8c-zw.png" /></figure><pre># Reset indexes in pandas to have only one index and sort values by Prod Year<br><br>df.groupby([&#39;Status&#39;,&#39;ProdYear&#39;]).agg({&#39;Status&#39;: &#39;count&#39;,<br>   &#39;Price&#39;: [&#39;mean&#39;,&#39;max&#39;,&#39;min&#39;]}).reset_index().sort_values(by=&#39;ProdYear&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*I9BKmempB35PzfCtYAzkPg.png" /></figure><h3><strong>10. Combining Data</strong></h3><p>Lets create new data</p><pre>id_cars = {&#39;idcars&#39;: [&#39;1&#39;,&#39;2&#39;,&#39;3&#39;,&#39;4&#39;,&#39;5&#39;,&#39;6&#39;,&#39;7&#39;,&#39;8&#39;],<br>        &#39;Brand&#39;: [&#39;Brio&#39;,&#39;Jazz&#39;,&#39;HRV&#39;,&#39;CRV&#39;,&#39;Civic&#39;,&#39;Mobilio&#39;,&#39;BRV&#39;,&#39;City&#39;]<br>        }<br><br>df_id = pd.DataFrame(id_cars)<br>df_id[&#39;table&#39;] = &#39;id_cars&#39;</pre><pre>cars1 = {&#39;idcars&#39;: [&#39;1&#39;,&#39;3&#39;,&#39;5&#39;,&#39;7&#39;,&#39;2&#39;,&#39;4&#39;,&#39;6&#39;,&#39;8&#39;],<br>        &#39;Price&#39;: [148,252,300,467,536,205,251,355],<br>         &#39;Year&#39; : [2022,2021,2020,2022,2021,2020,2019,2020]<br>        }<br><br>df1 = pd.DataFrame(cars1)<br>df1[&#39;table&#39;] = &#39;cars1&#39;</pre><pre>cars2 = {&#39;idcars&#39;: [&#39;1&#39;,&#39;2&#39;,&#39;3&#39;,&#39;4&#39;,&#39;5&#39;,&#39;6&#39;,&#39;7&#39;,&#39;8&#39;],<br>        &#39;Price&#39;: [130,240,290,450,520,190,240,340],<br>         &#39;Year&#39; : [2021,2020,2019,2021,2020,2019,2018,2019]<br>        }<br><br>df2 = pd.DataFrame(cars2)<br>df2[&#39;table&#39;] = &#39;cars2&#39;</pre><p>Pandas has three core methods for doing this. In order of increasing complexity, these are concat(), join(), and merge().</p><p>We will omit it and focus on the first two functions here concat() and merge(). Most of what merge() can do can also be done more simply with join().</p><p>concat() The simplest concatenation method is concat(). Given a list of elements, this function will concatenate those elements along an axis.</p><pre>df = pd.concat([df1, df2])<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*opGtCqfg9ClkCVi9CwMpmw.png" /></figure><p>merge() A Merge / join clause is used to combine rows from two or more tables, based on a related column between them. The joining requirement is the existence of a primary key and a foreign key so that the two tables are joined</p><p>The different types of Joints are as follows:</p><ol><li>Inner join</li><li>Left join</li><li>Right join</li><li>Full join</li></ol><pre>df_new = pd.merge(df, df_id, on = &#39;idcars&#39; , how = &#39;left&#39; )<br>df_new.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*xI6YhXh61_LyZs-Ejh3LFQ.png" /></figure><p>if we look at the results of the join above, there are columns “table_x” and “table_y” because both tables have these columns. The way to handle it is in the second table <em>(df_id)</em> , delete the same column by changing the way it is called when doing a join.</p><pre>df_new = pd.merge(df, df_id[[&#39;idcars&#39;,&#39;Brand&#39;]], on =&#39;idcars&#39;, how =&#39;left&#39;)<br>df_new.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*0fPPPxM4hBPhISHigecWfA.png" /></figure><h3>11. Pandas visualization</h3><p>The pandas library in python is primarily used for data analysis. It’s not a data visualization library but, we can create basic plots using Pandas. Pandas is very useful and practical if we want to make exploratory data analysis plots. We need to import a data visualization library other than Panda for tasks like matplotlib.</p><p><a href="https://pandas.pydata.org/pandas-docs/stable/user_guide/visualization.html">Chart visualization - pandas 1.5.1 documentation</a></p><pre>import matplotlib.pyplot as plt</pre><pre>ts = pd.Series(np.random.randn(1000), index=pd.date_range(&quot;1/1/2000&quot;, periods=1000))<br>ts = ts.cumsum()<br><br>df = pd.DataFrame(np.random.randn(1000, 4), index=ts.index, columns=list(&quot;ABCD&quot;))<br>df = df.cumsum()<br><br>plt.figure();<br><br>df.plot();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*noDKmIyshsMhlJFxww4Pdw.png" /></figure><pre>plt.figure();<br><br>df.iloc[5].plot(kind=&quot;bar&quot;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*2LWPf9IR-pLa-Erc4YAnBw.png" /></figure><pre>df2 = pd.DataFrame(np.random.rand(10, 4), columns=[&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;])<br><br>df2.plot.bar();</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*JkPioc-MLlLCRYL8DxVi0A.png" /></figure><pre>df4 = pd.DataFrame(<br>    {<br>        &quot;a&quot;: np.random.randn(1000) + 1,<br>        &quot;b&quot;: np.random.randn(1000),<br>        &quot;c&quot;: np.random.randn(1000) - 1,<br>    },<br>    columns=[&quot;a&quot;, &quot;b&quot;, &quot;c&quot;],<br>)<br><br><br>plt.figure();<br><br>df4.plot.hist(alpha=0.5);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*GOyHHkdh5fv6WE-8r7k6uQ.png" /></figure><h3>Summary</h3><p>To summarize, in this post we cover how to use the Pandas library.</p><ol><li>What is Pandas ?</li><li>Import Pandas</li><li>Try Data Frames</li><li>Head and Tail</li><li>Slicing</li><li>Conditional selection</li><li>Descriptive Statistics</li><li>Case Expression</li><li>Grouping and Sorting</li><li>Combining Data</li><li>Pandas visualization</li></ol><p>To understand pandas more you can visit pandas documentation</p><p><a href="https://pandas.pydata.org/pandas-docs/stable/index.html">pandas documentation - pandas 2.2.3 documentation</a></p><p>Best Regards</p><p>Lintang Gilang</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55bebfec3e7e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belajar-nulis/this-pandas-skill-will-get-you-a-job-55bebfec3e7e">This Pandas skill will get you a job</a> was originally published in <a href="https://medium.com/belajar-nulis">Lintang Gilang</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contoh Lanjutan implementasi “FuzzyWuzzy” untuk cleansing data nama]]></title>
            <link>https://medium.com/belajar-nulis/contoh-lanjutan-implementasi-fuzzywuzzy-untuk-cleansing-data-nama-461f7fc8f406?source=rss----278800007f59---4</link>
            <guid isPermaLink="false">https://medium.com/p/461f7fc8f406</guid>
            <category><![CDATA[fuzzy-matching]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[fuzzywuzzy]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[similarity]]></category>
            <dc:creator><![CDATA[Lintang Gilang Pratama]]></dc:creator>
            <pubDate>Thu, 08 Apr 2021 04:07:25 GMT</pubDate>
            <atom:updated>2021-04-08T04:07:57.155Z</atom:updated>
            <content:encoded><![CDATA[<h3>Contoh lanjutan implementasi “FuzzyWuzzy” untuk cleansing data nama</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UcQpd43L2VumRDBg" /><figcaption>Photo by <a href="https://unsplash.com/@john_cameron?utm_source=medium&amp;utm_medium=referral">John Cameron</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>FuzzyWuzzy adalah suatu package di python, yang dapat digunakan untuk mencari kemiripan (<em>matching</em>) dari suatu string terhadapat suatu kumpulan string. Package ini secara teori menggunakan pendekatan “Levenshtein Distance”.</blockquote><blockquote>~~Lintang Gilang Pratama di tulisan <a href="https://medium.com/belajar-nulis/contoh-implementasi-fuzzywuzzy-pada-pandas-python-62de6898a4d0">FuzzyWuzzy</a></blockquote><p>Sebelumnya saya telah membahas tentang penggunaan FuzzyWuzzy<em> </em>untuk melakukan similirity merek mobil, dimana brand “Honda Civic” memiliki similirity dengan “Honda” dan brand “Toyota Corolla” memiliki similiry dengan “Toyota” dengan nilai similirity sebesar 90.</p><p>Pada case sebelumnya kita terbantu karena sudah memiliki list atau dictionary dari merk mobil yaitu :</p><pre>Merek = [&#39;Honda&#39;,&#39;Toyota&#39;,&#39;Ford&#39;,&#39;Audi&#39;,&#39;Suzuki&#39;,&#39;Yamaha&#39;]</pre><p>Muncul sebuah pertanyaan, yang kebetulan merupakan pertanyaan saat saya interview kerja hehehe,</p><pre><strong>Bagaimana jika tidak memiliki dictionary? <br>Apakah masih bisa dilakukan pencarian similirity? </strong></pre><p>Jawaban nya adalah <strong>BISA</strong>, lantas bagaima cara nya? Metode apa yang dapat digunakan? Pada tulisan ini saya akan mencoba memberikan contoh penggunaan FuzzyWuzzy dalam mencari similiry pada data nama dan alur dari code versi saya.</p><h3><strong>Contoh</strong></h3><p>Diketahui terdapat suatu data dummy sebanyak 29 nama yang jika dilihat secara sekilas terdapat delapan orang yang penulisan nama nya berbeda beda, berikut datanya.</p><pre>Nama = {&#39;Nama&#39;:</pre><pre>[&#39;M Haykal Narendra&#39;,&#39;Muhammad Haykal Narendra&#39;,&#39;M Haykal N&#39;,&#39;Haykal Narendra&#39;, &#39;Haykal N&#39;,</pre><pre>&#39;Lintang Gilang Pratama&#39;, &#39;Lintang Gilang&#39;, &#39;Lintang G P&#39;, &#39;Lintang&#39;, &#39;Lintang Gilang P&#39;,</pre><pre>&#39;Rindhy&#39;,&#39;Rindhyy Utami Muris&#39;, &#39;Rindhy Utami M&#39;, &#39;Rindi Utami &#39;, &#39;Rindhy Utami&#39;,</pre><pre>&#39;Dimas Galih Satrio&#39;, &#39;Dimass Galih&#39;, &#39;Dimas G S&#39;, &#39;Dimas Galih S&#39;, &#39;Dimas&#39;,</pre><pre>&#39;Agung&#39;, &#39;Agung Kurniawan&#39;, &#39;Agung Kurniawan Sastro&#39;, &#39;Agung K S&#39;, &#39;Agungg Kurniawan&#39;,</pre><pre>&#39;Haykal Lintang Rindhy Dimas Agung&#39;,&#39;Jokowi&#39;,&#39;Fiqaha&#39;, &#39;Fiqaha Hawalin&#39;],}</pre><pre>df = pd.DataFrame(Nama, columns = [&#39;Nama&#39;])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*opm5Z7OhCk34Gvn5eFlSwA.png" /></figure><p>Pada data dummy ini saya memberikan beberapa “jebakan” seperti :</p><ol><li>Terdapat satu nama yang merupakan gabungan dari beberapa nama yaitu “Haykal Lintang Rindhy Dimas Agung”</li><li>Terdapat tiga nama yang saya buat seperti kelebihan penulisan yaitu “Rindh<strong>yy</strong> Utami Muris”, “Dima<strong>ss</strong> Galih”, dan “Agun<strong>gg</strong> Kurniawan”</li><li>Terdapat delapan nama yang ditulis dengan memiliki singkatan seperti “M Haykal N” dan “Dimas G S”</li></ol><p>Tugas kita terhadap data ini adalah mengklasifikan data tersebut dan mencari similirity terhadapa nama lain, sehingga database yang dimiliki lebih rapi</p><h3><strong>Pembahasan</strong></h3><p>Pada tahap ini saya akan menerangkan alur dari code versi saya, tahap awal adalah membuat list atau dictionary yang bertujuan sebagai acuan similirity berikut adalah step text processing nya</p><ol><li>Buat kolom dummy dari data nama tersebut</li><li>Buat kolom panjang dari karakter huruf dari data nama</li><li>Buat kolom banyak nya kata dari data nama</li><li>Hapus singkatan nama dimana hal ini bertujuan untuk memberikan insight yang lebih “bermakna” karena menurut saya terkadang singkatan memberi bias yang cukup tinggi</li><li>Sorting data dari paling banyak huruf ke paling sedikit tujuan nya membuat prioritas acuan data yang akan digunakan sebagai dasar similirity</li><li>Lakukan remove duplikat pada dictionary</li><li>“dictionary_1” telah diperoleh</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*bHdvD7oiPX8YGI8Im__nXg.png" /></figure><p>Step berikutnya adalah melakukan similirity menggunakan “dictionary_1”</p><ol><li>Lakukan similirity data dummy terhadap “dictionary_1” menggunakan package FuzzyWuzzy dengan scorer = fuzz.ratio</li><li>Hasil dari step ini adalah similirity data dummy terhadap “dictionary_1” yang mana pada urutan satu merupakan similirity score 100 adalah dirinya sendiri dan urutan berikut nya adalah similirity yang mendekati score 100</li><li>Lakukan filtering terhadap hasil similirity, dimana data yang diambil adalah jika similirity urutan kedua &gt; 80, namun jika tidak maka yang diambil adalah similirity urutan kesatu tujuan nya adalah agar meng-global kan dictionary</li><li>Lakukan remove duplikat pada dictionary</li><li>“dictionary_2” telah diperoleh</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/488/1*YAD5vc4DHoAJVMveaJmLGw.png" /></figure><p>Step Berikut nya adalah filtering dictionary kembali dengan cara melakukan similirity terhadapat “dictionary_2” dengan score 100, maka diperoleh “dictionary_3&quot; sebanyak 16 data dari sebelum nya 29 data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*ncbN3aAeDJ7xc326EtK19A.png" /></figure><p>Step selanjutnya adalah similirity per kata tujuan nya adalah untuk merapikan kata nya huruf nya kurang atau lebih beberapa huruf seperti “Dimass” seharusnya “Dimas”</p><ol><li>Berdasarkan “dictionary_3&quot; lakukan split perkata sehingga diperolah “dictionary_kata” dan “dictionary_kata” ini tidak di remove duplikat</li><li>Lakukan similirity terhadap “dictionary_kata” terhadap dirinya sendiri</li><li>Similirity yang diambil adalah urutan kedua karena dengan asumsi kata yang memiliki kelebihan atau kurang huruf tidak lah banyak jumlah nya, sehingga dengan mengambil urutan kedua maka kita mengambil data terbanyak yang memiliki similirity terdekat, dimana syarat nya adalah jika score similirity urutan kedua &gt; 80, jika tidak maka diambil similirity urutan satu, hasil nya sebagai berikut</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*vdLNVpL9xI5FeuOxrtrbZQ.png" /></figure><p>Berdasrkan hasil diatas terlihat bahwa “Dimass” memiliki similirity dengan “Dimas” . Terlihat hanya ada tiga kata yang berstatus “False”. Menggunakan data diatas kita dapat melakukan replace word dari “dictionary_3” sebagai “y” menjadi “x” seperti pada data diatas sehingga diperoleh “dictionary_4”.</p><p>Setelah kita memperoleh “dictionary_4” maka kita bisa menggukan dictionary ini sebagai dictionary final yang akan kita gunakan di data dummy diawal, berikut hasil nya</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*8aV6-aSzQOxCRZH9PMpJRw.png" /></figure><h3>Kesimpulan</h3><p>Berdasarkan alur code seperti ini diperoleh 16 nama dari 29 data, karena pada proses text processing paling awal kita membentuk 11 data dengan satu kata saja yang mana dengan alur satu kata adalah satu nama sehingga memberikan impact yang cukup besar.</p><p>Hasil akan bisa lebih akurat jika dapat digabungkan dengan data lain, misal seperti data ID atau nomor telepon.</p><p>Alur ini juga masih dapat dikembangkan lebih lanjut seperti merubah menjadi huruf kecil semua , nama tanpa spasi atau saat melakukan similirity dengan huruf konsonan saja.</p><p>Sekian dulu dari saya tekait proses similiry tanpa dictionary untuk kode lengkap dapat di klik di github saya <a href="https://github.com/lintanggilang">lintang gilang pratama</a> atau bisa download <a href="https://colab.research.google.com/drive/12uvIcZgQXz3uJ5AVg9_UJQOd83lA5DES?usp=sharing">colab</a>.</p><p>Terimkasih</p><p>Lintang Gilang Pratama</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=461f7fc8f406" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belajar-nulis/contoh-lanjutan-implementasi-fuzzywuzzy-untuk-cleansing-data-nama-461f7fc8f406">Contoh Lanjutan implementasi “FuzzyWuzzy” untuk cleansing data nama</a> was originally published in <a href="https://medium.com/belajar-nulis">Lintang Gilang</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploratory Data Analysis adalah . . .]]></title>
            <link>https://medium.com/belajar-nulis/exploratory-data-analysis-adalah-c8d3ddc0d537?source=rss----278800007f59---4</link>
            <guid isPermaLink="false">https://medium.com/p/c8d3ddc0d537</guid>
            <category><![CDATA[eda]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[titanic]]></category>
            <dc:creator><![CDATA[Lintang Gilang Pratama]]></dc:creator>
            <pubDate>Mon, 07 Dec 2020 09:18:59 GMT</pubDate>
            <atom:updated>2024-05-17T09:22:28.193Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exploratory Data Analysis adalah . . .</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aGw4_OxVDB_izXOu" /><figcaption>Photo by <a href="https://unsplash.com/@editholic7?utm_source=medium&amp;utm_medium=referral">Kunal Shinde</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Exploratory Data Analysis (EDA) adalah secara ringkas dapat diartikan sebagai suatu proses pemahaman data untuk memperoleh informasi sebanyak-banyak nya.</p><p>Bagaimana cara melakukan Exploratory Data Analysis (EDA)? Seorang analyst akan menggunakan banyak tehnik dalam melakukan EDA dan metode yang akan digunakan akan berbeda-beda, sehingga tidak terdapat aturan baku dalam melakukan suatu analisa data, namun secara garis beras terbagi menjadi empat tahapan yaitu :<br>1. Mencari tahu tipe dan ukuran data melalui Data Dictionary<br>2. Analisa deskriptif<br>3. Membuat list pertanyaan untuk ditanyakan pada data<br>4. Visualisasi Data</p><h3>Contoh Exploratory Data Analysis (EDA)</h3><p>Pada tulisan ini akan diberikan contoh EDA dengan dataset titanic dari website kaggle</p><pre><strong>import </strong>pandas <strong>as </strong>pd<br><strong>import </strong>seaborn <strong>as </strong>sns<br><strong>import </strong>matplotlib.pyplot <strong>as </strong>plt</pre><pre>df = pd.read_csv(&#39;train.csv&#39;, index_col = &#39;PassengerId&#39;)</pre><h3>Mencari tahu tipe data melalui Data Dictionary</h3><p>Data dictionary adalah informasi mengenai data seperti arti, relasi dengan data yang lain, asal data, penggunaan dan format. biasnya diperoleh dari Data Warehouse. Data Dictionary untuk data titanic adalah</p><ol><li>Survived : 0 = No, 1 = Yes</li><li>Pclass : Kelas (1 = 1st, 2 = 2nd, 3 = 3rd)</li><li>Name : Nama penumpang</li><li>Sex : Gender penumpang</li><li>Age : Usia penumpang</li><li>SibSp : Jumlah saudara atau pasangan</li><li>Parch : Jumlah anak atau orang tua</li><li>Ticket : Nomor tiket</li><li>Fare : Harga pembelian tiket</li><li>Cabin : Nomor kabin</li><li>Embarked : Kota keberangkatan (C = Cherbourg, Q = Queenstown, S = Southampton)</li></ol><pre><strong>df.columns</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*TkqITYuPcdxA4ECloHGGXQ.png" /></figure><pre><strong>df.info()</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*LK9b1LKYaiOjh_I_CISd7A.png" /></figure><p>Berikut adalah contoh informasi yang diperoleh adalah</p><ol><li>Data terdiri dari 7 data kategorik (object) yaitu Survived, Pclass, Name, Sex, Ticket, Cabin dan Embarked</li><li>Data terdiri dari 4 data numerik yaitu Age, SibSp, Parch dan Fare</li><li>Pada feature Age terdapat 177 missing value</li><li>Pada feature Cabin terdapat 687 missing value</li><li>Pada feature Embarked terdapat 2 missing value</li></ol><p>Pada tahap ini analyst akan mengambil keputusan apakah data perlu dicleansing? apakah missing value akan didrop atau di-impute? feature mana saja yang dapat dianalisa?</p><h3>Analisa deskriptif</h3><pre><strong>df.describe()</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*LxfSjlhsJ_MW8qVJjSK7gg.png" /></figure><pre><strong>df.Survived.value_counts(&quot;Survived&quot;)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*uGK0T2BBqjoHgx5gnDEM2g.png" /></figure><pre><strong>df.Survived.value_counts(&quot;Pclass&quot;)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*0ArnlNRtbOB8WlQq68i5Yw.png" /></figure><pre><strong>df.Survived.value_counts(&quot;Sex&quot;)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*ktbWb7GvX7nqlEmLx73icA.png" /></figure><pre><strong>pd.crosstab(df.Pclass, df.Survived)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/1*qmhm017gVO43UIDo_GqxGQ.png" /></figure><pre><strong>pd.crosstab(df.Sex, df.Survived)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/1*Q5MdSXRijAH2bRpv4iJxkw.png" /></figure><p>Berikut adalah contoh informasi yang diperoleh pada Analisa Deskritif adalah</p><ol><li>Rata-rata usia penumpang adalah 29 tahun dengan std ± 14 tahun</li><li>Diketahui 61% Penumpang titanic selamat</li><li>55% penumpang titanic adalah kelas-3</li><li>Gender paling banyak adalah “male”</li><li>Penumpang kelas-3 kebanyak tidak selamat</li><li>Walaupun “male” adalah gender paling banyak namun gender yang banyak tidak selamat adalah “male”</li></ol><h3>Membuat list pertanyaan untuk ditanyakan pada data</h3><p>Membuat list pertanyaan merupakan tahap yang paling krusial dimana analyst membuat suatu hipotesis atau pertanyaan dari data untuk mendapat informasi, sehingga analyst banyak menghabiskan waktu dalam tahapan ini karena pertanyaan yang dibuat harus relevan dengan data dan terkadang dituntut untuk “out off the box”. Pertanyaan yang dibuat bisa termasuk analisa deskriptif yang belum dilakukan, analisa analisa sebab-akibat, melakukan klasifikasi data dan sebagai nya, sehingga untuk membuat suatu pertanyaan yang baik dibutuhkan knowledge dan pengalaman yang tinggi, tahapan ini dapat dilakukan diawal dan saat melakukan analisa data. Setelah pertanyaan atau hipotestis dibuat, seorang analyst akan melakukan olah data untuk mendapat jawaban dari pertanyaan tersebut, jika proses analisa menggunakan programming tentu akan membutuhkan waktu yang lebih lama.</p><blockquote>“proses pembuatan list pertanyaan sebaik ditulis tidak hanya dikepala saja”</blockquote><p>Contoh pertanyaan<br>1. Jika wanita adalah gender yang paling banyak selamat dan penumpang kelas 3 kebanyakan tidak selamat, apakah wanita dikelas 3 juga paling banyak selamat dikelas nya?<br>2. Jika suatu kapal dalam keadaan darurat biasanya yang diutamakan adalah wanita dan anak-anak, apakah wanita dan anak-anak yang paling banyak selamat?<br>3. Apakah terdapat suatu ciri-ciri penumpang yang selamat dan tidak selamat?<br>4. Apakah data ini termasuk data kru kapal? Bagaimana cara deteksi mana yang merupakan kru kapal?<br>5. Metode machine learning apa yang cocok untuk data untuk prediksi selamat atau tidak? Kenapa?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aTrhyZASGhURNnqs" /><figcaption>Photo by <a href="https://unsplash.com/@sctgrhm?utm_source=medium&amp;utm_medium=referral">Scott Graham</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Visualisasi Data</h3><p>Pengambilan suatu keputusan haruslah didasarkan pada data dan fakta yang ada. Agar data tersebut lebih mudah dipahami, maka data harus divisualisasikan</p><blockquote>“Un bon croquis vaut mieux qu’un long discours” (Napoleon, Kaisar Perancis)</blockquote><blockquote>“Sketsa yang bagus lebih baik daripada pidato yang panjang”</blockquote><p>Sketsa yang dimaksud Napoleon adalah data yang telah divisualisasikan dengan baik sehingga bisa dipahami. Di sini jelas bahwa visualisasi data diperlukan supaya penyampaian informasi jauh lebih efektif. Visualisasi data dapat dilakukan saat dan sesudah melakukan analisa</p><p>Contoh Visualisasi Data</p><pre>cat_var = [&#39;Pclass&#39;,&#39;Sex&#39;]</pre><pre>fig, axes = plt.subplots(1,2, figsize=(10,5))<br>for cat, ax in zip(cat_var, axes.flatten()):<br>    sns.countplot(cat, data=df, hue=&#39;Survived&#39;,ax=ax)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*_vSwxmrF9Angj06ox1R94Q.png" /></figure><p>Terimakasih</p><p><strong>Lintang Gilang</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8d3ddc0d537" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belajar-nulis/exploratory-data-analysis-adalah-c8d3ddc0d537">Exploratory Data Analysis adalah . . .</a> was originally published in <a href="https://medium.com/belajar-nulis">Lintang Gilang</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contoh dan trik implementasi “IF” pada pandas seperti di Ms.Excel]]></title>
            <link>https://medium.com/belajar-nulis/contoh-dan-trik-implementasi-if-pada-pandas-seperti-di-ms-excel-fa9b53fcac82?source=rss----278800007f59---4</link>
            <guid isPermaLink="false">https://medium.com/p/fa9b53fcac82</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[if]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Lintang Gilang Pratama]]></dc:creator>
            <pubDate>Sun, 06 Dec 2020 03:19:16 GMT</pubDate>
            <atom:updated>2021-11-10T09:24:02.092Z</atom:updated>
            <content:encoded><![CDATA[<h3>Contoh implementasi “IF” pada Pandas (Python) seperti di Ms.Excel</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pxsOHQdtG43nFJQb" /><figcaption>Photo by <a href="https://unsplash.com/@brett_jordan?utm_source=medium&amp;utm_medium=referral">Brett Jordan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>Microsoft Excel is still the most used program in business. In Excel’s defense, it has some advantages; Due to it’s longevity and prevalence it is widely understood. Most computers have a program pre-installed that can open a spreadsheet prepared in Excel. ~~paulclarke.com.au~~</blockquote><p>Ms.Excel adalah suatu program spreadsheet keluaran Ms.Office yang terdiri dari baris dan kolom dimana sering digunakan untuk analisa data. Ms.Excel memiliki segudang keungulan seperti Interface yang fleksibel, mudah di pelajari dan digunakan hampir diseluruh industri. Namun, untuk melakukan analisa data skala besar Ms. Excel tidak lagi mampu dikarenakan jumlah baris dan kolom yang terbatas.</p><p>Untuk menjawab permasalahan Ms.Excel tersebut para data analyst biasa menggunakan SQL dan pandas.</p><h3>Bagaimana cara menggunakan “IF” pada pandas seperti di Ms.Excel?</h3><p>Fungsi IF pada excel sering digunakan untuk klasifikasi data agar mendapat suatu summary awal. Pada tulisan ini, saya akan memberi contoh dan trik penggunaan IF pada pandas</p><p>Diketahui terdapat suatu data dengan kolom “Brand” dan “Price”</p><pre><strong>import</strong> pandas <strong>as</strong> pd<br><br>cars = {&#39;Brand_Honda&#39;: <br>        [&#39;Brio&#39;,&#39;Jazz&#39;,&#39;HRV&#39;,&#39;CRV&#39;,&#39;Civic&#39;,&#39;Mobilio&#39;,&#39;BRV&#39;,&#39;City&#39;],<br>        &#39;Price_Juta&#39;: [148,252,300,467,536,205,251,355]<br>        }</pre><pre>df = pd.DataFrame(cars, columns = [&#39;Brand_Honda&#39;, &#39;Price_Juta&#39;])<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*e6RlNMgBChJQHR4q2glWdw.png" /></figure><h3>Case 1 :</h3><p>Jika nilai price dibawah 250 maka “&lt;250” , lainnya adalah “&gt;250”</p><pre># Metode 1<br># Menggunakan &quot;loc&quot;</pre><pre>df.loc[df[&#39;Price_Juta&#39;] &lt; 250, &#39;klasifikasi_Price&#39;] = &#39;&lt; 250&#39;<br>df[&#39;klasifikasi_Price&#39;] = df[&#39;klasifikasi_Price&#39;].fillna(&#39;&gt; 250&#39;)<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*M4s5_4ew_0mGWHsJkThlwQ.png" /></figure><pre># Metode 2<br># Menggunakan &quot;lambda&quot;</pre><pre>df[&#39;klasifikasi_Price&#39;] = df[&#39;Price_Juta&#39;].apply(lambda x: &#39;&lt; 250&#39; if x &lt; 250 else &#39;&gt; 250&#39;)<br><br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*U1tOzkMtNiw6eoBWLopYOQ.png" /></figure><pre># Metode 3<br># Menggukan &quot;cut&quot;</pre><pre>df[&#39;klasifikasi_Price&#39;] = pd.cut(df.Price_Juta,[0,250,1000], <br>                                 labels=[&#39;&lt; 250&#39;,&#39;&gt; 250&#39;])</pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*ERHJ6gF7XP8oH6M5XxaIrg.png" /></figure><h3>Case 2 :</h3><p>Jika Brand adalah Brio, Mobilio, Jazz dan BRV maka “Honda &lt; 300” , lainnya “Honda &gt; 300”</p><pre># Menggunakan &quot;loc&quot;</pre><pre>df.loc[df[&#39;Brand_Honda&#39;] == &#39;Brio&#39;, &#39;Brand&#39;] = &#39;Honda &lt; 300&#39;<br>df.loc[df[&#39;Brand_Honda&#39;] == &#39;Mobilio&#39;, &#39;Brand&#39;] = &#39;Honda &lt; 300&#39;<br>df.loc[df[&#39;Brand_Honda&#39;] == &#39;Jazz&#39;, &#39;Brand&#39;] = &#39;Honda &lt; 300&#39;<br>df.loc[df[&#39;Brand_Honda&#39;] == &#39;BRV&#39;, &#39;Brand&#39;] = &#39;Honda &lt; 300&#39;<br>df[&#39;Brand&#39;] = df[&#39;Brand&#39;].fillna(&#39;Honda &gt; 300&#39;)<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*r6OpxHwXoK0_dglJvXW2Yw.png" /></figure><h3>Case 3 :</h3><p>Jika “&lt; 250” dan “Honda &lt; 300” maka “murah” , lainnya adalah “mahal”</p><pre># Menggunakan &quot;loc&quot;</pre><pre>df.loc[(df[&#39;klasifikasi_Price&#39;] == &#39;&lt; 250&#39;) <br>       &amp; (df[&#39;Brand&#39;] == &#39;Honda &lt; 300&#39;), &#39;Keterangan&#39;] = &#39;Murah&#39;<br>df[&#39;Keterangan&#39;] = df[&#39;Keterangan&#39;].fillna(&#39;Mahal&#39;)<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*T8bfIEv_Fke1wAB39uG7Jg.png" /></figure><p>Ms. Excel merupakan alat yang paling efisien dalam analisa data secara statistika deskriptif, karena efisen, cepat dan mudah untuk digunakan. Pandas dan python hadir sebagai media analisa dengan tingkatan analisa yang lebih tinggi dan memiliki skala dimensi yang lebih besar. Memahami Ms.Excel dan Pandas merupakan hal yang sangat menguntungkan sebagai seorang data analyst ataupun bukan, karena sebagai langkah awal dalam melakukan analisa dan menerjemahkan data ke dalam laporan yang dapat dipahami management atau user.</p><p>Terimakasih</p><p><strong>Lintang Gilang Pratama</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa9b53fcac82" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belajar-nulis/contoh-dan-trik-implementasi-if-pada-pandas-seperti-di-ms-excel-fa9b53fcac82">Contoh dan trik implementasi “IF” pada pandas seperti di Ms.Excel</a> was originally published in <a href="https://medium.com/belajar-nulis">Lintang Gilang</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contoh implementasi “FuzzyWuzzy” pada pandas python]]></title>
            <link>https://medium.com/belajar-nulis/contoh-implementasi-fuzzywuzzy-pada-pandas-python-62de6898a4d0?source=rss----278800007f59---4</link>
            <guid isPermaLink="false">https://medium.com/p/62de6898a4d0</guid>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[wuzzy]]></category>
            <category><![CDATA[matching]]></category>
            <category><![CDATA[fuzzy]]></category>
            <category><![CDATA[fuzzywuzzy]]></category>
            <dc:creator><![CDATA[Lintang Gilang Pratama]]></dc:creator>
            <pubDate>Sun, 06 Dec 2020 03:17:52 GMT</pubDate>
            <atom:updated>2020-12-07T06:01:52.834Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hZIwypdUIXmmCdXn" /><figcaption>Photo by <a href="https://unsplash.com/@billow926?utm_source=medium&amp;utm_medium=referral">billow926</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>There are applications in fields such as spell checking or bioinformatics to match DNA sequences, so then there is definitely more uses for fuzzy matching.~~datacamp.com~~</blockquote><p>FuzzyWuzzy adalah suatu package di python, yang dapat digunakan untuk mencari kemiripan (<em>matching</em>) dari suatu string terhadapat suatu kumpulan string. Package ini secara teori menggunakan pendekatan “Levenshtein Distance”.</p><h3>Contoh</h3><p>Diketahui terdapat suatu data dengan kolom “Brand” dan “Price”</p><pre><strong>import</strong> pandas <strong>as</strong> pd<br><br>cars = {&#39;Brand&#39;: <br>        [&#39;Honda Civic&#39;,&#39;Toyota Corolla&#39;,&#39;Ford Focus&#39;,&#39;Audi A4&#39;],<br>        &#39;Price&#39;: [22000,25000,27000,35000]<br>        }<br><br>df = pd.DataFrame(cars, columns = [&#39;Brand&#39;, &#39;Price&#39;])<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*IK99R5inPQUf9bWorlqNvA.png" /></figure><p>dan terdapat list “Merek” yang akan menjadi acuan kemiripan (<em>matching</em>).</p><pre>Merek = [&#39;Honda&#39;,&#39;Toyota&#39;,&#39;Ford&#39;,&#39;Audi&#39;,&#39;Suzuki&#39;,&#39;Yamaha&#39;]</pre><p>Tugas nya adalah klasifikasi suatu “Merek” pada data kolom “Brand”.</p><h3><strong>Pembahasan</strong></h3><p>Jika kita lihat karakteristik pada data kolom “Brand” selalu memiliki “Merek” sehingga problem ini dapat diselesaikan dengan package <em>FuzzyWuzzy.</em></p><pre><strong>from </strong>fuzzywuzzy <strong>import </strong>process</pre><pre>list_merek = []<br>similirity = []<br>df_Brand = df.Brand.tolist()</pre><pre>for x in df_Brand:<br>    highest = process.extractOne(x,Merek)<br>    list_merek.append(highest[0])<br>    similirity.append(highest[1])</pre><pre>df[&#39;Merek&#39;] = list_merek<br>df[&#39;similirity&#39;] = similirity<br>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*HAU6tKSTmlgT2SSixKi2tw.png" /></figure><h3><strong>Kesimpulan</strong></h3><p>Kolom “Merek” adalah hasil pencarian kemiripan dari kolom “Brand” dimana memiliki persentase kemiripan di kolom “similirity”. Dimana rata-rata kemiripan adalah 90.</p><blockquote>Fuzzy string matching like a boss. It uses Levenshtein Distance to calculate the differences between sequences in a simple-to-use package.</blockquote><p>Terimakasih</p><p><strong>Lintang Gilang Pratama</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62de6898a4d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/belajar-nulis/contoh-implementasi-fuzzywuzzy-pada-pandas-python-62de6898a4d0">Contoh implementasi “FuzzyWuzzy” pada pandas python</a> was originally published in <a href="https://medium.com/belajar-nulis">Lintang Gilang</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>