<?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 Vipul Kumar on Medium]]></title>
        <description><![CDATA[Stories by Vipul Kumar on Medium]]></description>
        <link>https://medium.com/@vipulkumar_36528?source=rss-baecc080a8ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*zmtZTEZDov6EFMis.</url>
            <title>Stories by Vipul Kumar on Medium</title>
            <link>https://medium.com/@vipulkumar_36528?source=rss-baecc080a8ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:18:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vipulkumar_36528/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[Use of Underscore in Python]]></title>
            <link>https://medium.com/@vipulkumar_36528/use-of-underscore-in-python-d91e293d17d?source=rss-baecc080a8ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/d91e293d17d</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[underscore]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[dunder]]></category>
            <category><![CDATA[magic-functions]]></category>
            <dc:creator><![CDATA[Vipul Kumar]]></dc:creator>
            <pubDate>Wed, 10 Nov 2021 06:20:52 GMT</pubDate>
            <atom:updated>2021-11-10T06:20:52.641Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*s9odPgeMHJB1H5La50htDA.png" /><figcaption>Python</figcaption></figure><p>If you are a python programmer, you must have heard about underscore. Python works with two type of underscore:</p><ol><li>single underscore ( _ )</li></ol><p>2. double underscore ( __ )</p><p>It is a very powerful syntax, so in this article I am going to discuss 5 use of underscore.</p><p><strong>1. In Interpreter:</strong></p><p>It returns the last executed expression value in the python interpreter.</p><p>&gt;&gt;&gt; val1 <strong>=</strong> 10</p><p>&gt;&gt;&gt; val2 <strong>=</strong> 10</p><p>&gt;&gt;&gt; _</p><p>Traceback (most recent call last):</p><p>File &quot;&lt;stdin&gt;&quot;, line 1, <strong>in</strong> &lt;module&gt;</p><p>NameError: name &#39;_&#39; <strong>is</strong> <strong>not</strong> defined</p><p>&gt;&gt;&gt; val1+val2</p><p>20</p><p>&gt;&gt;&gt; _</p><p>20</p><p>&gt;&gt;&gt; _ * 6</p><p>120</p><p>&gt;&gt;&gt; _</p><p>120</p><p>&gt;&gt;&gt; _ <strong>/</strong> 2</p><p>60</p><p><strong>2. With the For loops</strong></p><p>we don’t need an variable to traverse the for loop. We can access the each value by underscore.</p><pre>L = [&quot;Some&quot;, 4, &quot;value&quot;]<br>for _ in L:<br>    print(_)</pre><pre>Output:<br>Some<br>4<br>value<br>-----------------------------------------</pre><pre>Tuple = (10,20,30)<br>for _ in range(len(Tuple)):<br>    print(Tuple[_])</pre><pre>Output:<br>10<br>20<br>30</pre><p><strong>3. Use in Ignoring the variables:</strong></p><p>It is used to ignore the value, If someone doesn’t want to use some value while unpacking, just set the values to underscore ( _ ). We add values to underscore, if this is not used in the future code.</p><pre>a, _, c = &#39;Blogs&#39;, 10, &#39;Django&#39;<br>print(a, c)</pre><pre>Output:<br>Blogs Django</pre><pre>p, q, *_, r = &quot;Python&quot;, 4, &quot;Django&quot;, 1234, &#39;3.14&#39;, &quot;Flask&quot;<br>print(p,q,r)</pre><pre>output:</pre><pre>Python 4 Flask</pre><pre>print(_)<br>output:[&#39;Django&#39;, 1234, &#39;3.14&#39;]</pre><p><strong>4. Seperation of digits of Big number:</strong></p><p>Underscores <em>(_)</em> can also be used to represent long digits number, it separates the group of digits for better understanding.</p><pre># Seperating digit of numbers<br>crore = 10_00_000<br>print(crore)</pre><pre>Output:<br>1000000</pre><p><strong>5.Define access of data members and methods:</strong></p><p>We can access the _ and __ variable via methods in the class.</p><pre>class Lang:<br>    a = None<br>    _b = None<br>    __c = None<br><br>    def __init__(self,a,b,c):<br>        # Public<br>        self.a = a<br><br>        # Protected<br>        self._b = b<br><br>        # Private<br>        self.__c = c<br><br>    # Private Method<br>    def __display(self):<br>        print(self.a)<br>        print(self._b)<br>        print(self.__c)<br><br>    # Public Method<br>    def accessPrivateMethod(self):<br>        self.__display()<br><br>obj = Lang(&quot;Django&quot;, 4, &quot;Python&quot;)<br>obj.accessPrivateMethod()<br>print(obj._b)</pre><pre><br>Output:<br>Django 4 Python<br>4</pre><p><strong>Conclusion:</strong></p><p>In this article, we have discussed the use of undescore in some cases, I will try to explore more on this in next article.</p><p>I hope you have enjoyed the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d91e293d17d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fuzzy Query in Elastic Search.]]></title>
            <link>https://medium.com/@vipulkumar_36528/fuzzy-query-in-elastic-search-393c8db7c496?source=rss-baecc080a8ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/393c8db7c496</guid>
            <category><![CDATA[elk]]></category>
            <category><![CDATA[fuzziness]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[Vipul Kumar]]></dc:creator>
            <pubDate>Wed, 03 Nov 2021 14:51:39 GMT</pubDate>
            <atom:updated>2021-11-03T14:51:39.245Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/311/1*eFPdkVmnpiFCwLoP1bE9og.png" /><figcaption>ES</figcaption></figure><p><strong>Fuzzy Query:</strong></p><p>It returns the documents that have terms similar to the search query, it is calculated by <a href="https://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein Edit distance</a> formula.</p><p>Ex.</p><p>Chna —&gt; China</p><p>Jumpi — &gt; Jump, [edit distance as 1.]</p><p>Indisba — &gt; India,</p><p>Jumpi — &gt; Jumped [edit distance as 2.]</p><p>To find the similar terms, it creates all variations of the search term within a specified edit distance, then the query returns the exact matches for the query.</p><p><strong>Example.</strong></p><p>GET /new_data/_search</p><p>{</p><p>“_source”: [],</p><p>“query”: {</p><p>“multi_match”: {</p><p>“query” : “R hirani”,</p><p>“fields”: [“director”,”title”]</p><p>, “fuzziness”: 1</p><p>}</p><p>}</p><p>}</p><p>Here fuzziness is taken as 1, so it will take all the possible variations of one length.</p><p>0, 1, 2 : It is the maximum LV edit distance allowed.</p><p>For AUTO:</p><p>It calculates the edit distance based on the length of the term,</p><p>For 0 to 2 — It must match exactly</p><p>For 3 to 5 — Only one edit allowed</p><p>For &gt; 5 — Two edits allowed</p><p>Note:</p><p>Fuzziness works only with the basic match and multi match queries. It doesn’t work with phrase matching, common terms.</p><p><strong>Final Thoughts:</strong></p><p>Phew! I’m now satisfied for having given the attention on fuzziness. And yes, I know that this is not the first blog about Fuzziness in Elastic Search out there, but I wanted to have my take on it. There is a lot more to explore.</p><p>In the next blog I will share some exciting things in Elastic Search. Thanks for reading, I will see you in the next blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=393c8db7c496" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>