<?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 amrita.msdn@gmail.com on Medium]]></title>
        <description><![CDATA[Stories by amrita.msdn@gmail.com on Medium]]></description>
        <link>https://medium.com/@amrita-msdn?source=rss-d3cac6ee7144------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NGsjcXm2CxWGa_rZUkLdBA.png</url>
            <title>Stories by amrita.msdn@gmail.com on Medium</title>
            <link>https://medium.com/@amrita-msdn?source=rss-d3cac6ee7144------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 21:30:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amrita-msdn/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[Statistics — Part1]]></title>
            <link>https://amrita-msdn.medium.com/statistics-part1-776d38d739e1?source=rss-d3cac6ee7144------2</link>
            <guid isPermaLink="false">https://medium.com/p/776d38d739e1</guid>
            <dc:creator><![CDATA[amrita.msdn@gmail.com]]></dc:creator>
            <pubDate>Sun, 20 Sep 2020 17:16:25 GMT</pubDate>
            <atom:updated>2020-09-27T23:12:01.226Z</atom:updated>
            <content:encoded><![CDATA[<h3>Are you ready to work with me on different metrics used in measure of dispersion using numpy, Pandas | Python And Excel?</h3><p>Before writing anything in this blog, I wish to dedicate my all statistics blogs to Mr. Aravind Reddy Dudipala (Data Scientist, <a href="https://www.linkedin.com/in/aravind-reddy-dudipala-0ab58b15/">https://www.linkedin.com/in/aravind-reddy-dudipala-0ab58b15/</a>), my mentor.</p><p>In order to work on the data, first it’s very much important to understand the data. In the process of understanding how the data is distributed across in a variable we use certain metrics and Mean Absolute Deviation is one such metric. In a way this is a measure of dispersion.</p><p>The measures of central tendency aren’t sufficient to describe data. You’ll also need the <strong>measures of variability</strong> that quantify the spread of data points.A measure of spread or measure of dispersion gives us an idea of how well the mean, that is mean represents the data. But it represents well if our data is small dataset but if the spread of values in the data set is large, the mean misleads the data representation. The reason behind that why only mean is not suitable to represent a data for large dataset, is because a large spread indicates that there are probably large differences between individual scores. In such cases to get a more clarity or I can say to judge the accuracy of spread we need to consider the actual values of each score in a data set. The absolute deviation, variance and standard deviation are such measures.</p><p>To start work in data science we should know how to play with data and specially when we talk about Data Science that means data is not only data, it is <strong>BIG DATA</strong> and when we know that there is lot of dispersion in the data using variance, Std deviation , MAD etc. are the metric , we can think about Normalizing the data so that the data points can be brought to the same scale.</p><p><strong>In this post I am explaining each metrics used in data distribution :-</strong><br><em>1.) Range</em></p><p><em>2.)Variance</em></p><p><em>3.) Mean Absolute Deviation</em></p><p>4.)Standard Deviation</p><h3>Range</h3><p>Range is the simplest way of measurement of dispersion or variability. To calculate range the below is the formula-</p><blockquote><strong>Range = highest score - lowest score of dataset</strong></blockquote><p>Range actually tells you that your data should not cross the threshold value either critically low or high means, it does set the boundaries of the scores though it is used when measure of spread is limited. For example you have 100 students data who belongs to class 8th standard so the age expected range should be 13 to 14 years but if you have data less than 5 or 123 then it clearly crosses the boundary which means you have incorrect data in your dataset.</p><h3><strong>Calculate range using numpy —</strong></h3><p>The name of the function comes from the acronym for ‘peak to peak’. is the function to calculate range in numpy library in python, if you pass axis as 1 then it considered the columns otherwise rows</p><pre>import numpy as np<br>x = np.array([[4, 9, 2, 10],<br>              [6, 9, 7, 12]])<br>np.ptp(x,axis=1)</pre><pre>output -array([8, 6])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j1vyDFYHQa60Es_l_w74Tw.png" /></figure><h3>Quartiles and Interquartile Range</h3><p>Quartiles means when we divide spread of a data in to quarters like median we know breaks in half.</p><p>Suppose we have daily sales data for 100 days which have been ordered from the lowest to the highest sale, and the quartiles highlighted in different colors below dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NrLCcIlLgvdkm_ir2FH-AA.png" /></figure><p>The <strong>first quartile</strong> (Q1) lies between the 25th and 26th day’s sale, the <strong>second quartile</strong> (Q2) between the 50th and 51st day’s sale, and the <strong>third quartile</strong> (Q3) between the 75th and 76th day’s sale. Hence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*ifzpotLZwA76zEEIq_ElPA.png" /></figure><p><strong>Note</strong>- One thing to be noticed that whenever we would have even no of records then we will calculate quartile sale by the sum of the two values around each quartile and then half them otherwise we would only need to take the one value from 25th, 50th, 75th record if for example we have 99 rows dataset.</p><h3><strong>Calculate Quantile using numpy</strong></h3><pre>list1 =[35,37,37,38,39,39,39,39,39,40,40,40,40,40,40,41,41,42,42,42,42,42,44,44,45,45,45,45,<br>       47,48,49,49,49,49,51,51,51,51,52,52,53,53,54,55,55,56,57,57,58,58,59,60,61,62,62,<br>       62,63,63,64,64,64,64,65,66,67,67,67,67,68,69,69,69,70,70,71,71,71,72,74,74,74,74,<br>       74,75,75,76,77,77,79,80,81,81,81,81,81,81,83,84,84,85]</pre><pre>print(&#39;length of list \n&#39;,len(list1))</pre><pre>#count duplicate values, just for some computation to validate the data<br>my_dict = {i:list1.count(i) for i in list1}<br>print(&#39;Duplicate values count \n&#39; , my_dict)</pre><pre>print(&#39;Quantile \n&#39;,np.quantile(list1, [0.25,0.50,.75]))</pre><pre>Output -</pre><pre>length of list <br> 100<br>Duplicate values count <br> {35: 1, 37: 2, 38: 1, 39: 5, 40: 6, 41: 2, 42: 5, 44: 2, 45: 4, 47: 1, 48: 1, 49: 4, 51: 4, 52: 2, 53: 2, 54: 1, 55: 2, 56: 1, 57: 2, 58: 2, 59: 1, 60: 1, 61: 1, 62: 3, 63: 2, 64: 4, 65: 1, 66: 1, 67: 4, 68: 1, 69: 3, 70: 2, 71: 3, 72: 1, 74: 5, 75: 2, 76: 1, 77: 2, 79: 1, 80: 1, 81: 6, 83: 1, 84: 2, 85: 1}<br>Quantile <br> [45.  58.5 71. ]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ha3w_JZWLtX__kNGrSNkXA.png" /></figure><p>Quartiles are a useful measure of spread because they are much less affected by outliers or a skewed data set than the equivalent measures of mean and standard deviation. For this reason, quartiles are often reported along with the median as the best choice of measure of spread and central tendency, respectively, when dealing with skewed and/or data with outliers. A common way of expressing quartiles is as an interquartile range. The interquartile range describes the difference between the third quartile (Q3) and the first quartile (Q1), telling us about the range of the middle half of the scores in the distribution. Hence, for our 100 days sale:</p><p>Interquartile range = Q3 — Q1<br>= 71–45<br>= 26</p><h3><strong>Calculate </strong>Interquartile<strong> using numpy-</strong></h3><pre>quartiles = np.quantile(list1, [0.25, 0.75])<br>quartiles[1] - quartiles[0]</pre><pre>output - 26.0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E5x3YIJu6hgXXBDvyJ-zig.png" /></figure><p><em>2.)Variance</em></p><p>*Dispersion means distance and distance cannot be in negative</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bs_5c5_rH5tAup4cXmrYmw.png" /></figure><p><em>3.) Mean Absolute Deviation</em></p><p>4.)Standard Deviation</p><h3>Mean absolute deviation (MAD) and why it is needed?</h3><p>Deviation, is a measure of difference between the observed value of a variable and some other value, often that variable’s mean.Now we need to understand that why we need to absolute a value see the deviation from mean. See if we take an example of 100 students and suppose out of 100 students if average score is 58.75. Then think about a student who scored 60 i.e. it is deviating from mean to 60–58.75 = 1.25. Now the important point to note that scores above the mean have positive deviations (as demonstrated above), and scores below the mean will have negative deviations.</p><p>So find out the total variability in our data set, we would perform this calculation for all of the 100 students’ scores. However, the problem is that because we have both positive and minus signs, when we add up all of these deviations, they cancel each other out, giving us a total deviation of zero. Since we are only interested in the deviations of the scores and not whether they are above or below the mean score, that is the reason Absolute came into the picture and we ignore the minus sign when calculate Absolute Deviation .</p><p>The following steps show how to calculate average deviation for the mean. If you want to calculate average deviation for the median, just replace any value for the mean with the value for the median.</p><p><strong>The absolute deviation formula</strong> (i.e. the formula to calculate the distance for one point) is:<br>Absolute deviation = |x — x̄|</p><p>Which leads to the <strong>average deviation formula:</strong><br>Dx = (|x1 — x̄| + |x2 — x̄| +…+ |x3 — x̄|) / N</p><h3>Steps to follow for calculating Average Deviation-</h3><p>Suppose we have data set like 3,8,8,8,8,9,9,9,9.</p><ol><li><strong>Calculate Mean- </strong>x̄ = Sum of dataset/ Total No of Elements</li></ol><pre>x̄ = 3+8+8+8+8+9+9+9+9/9<br>= 7.89</pre><p>2. Find each individual absolute deviation using the formula |x — x̄|.</p><ul><li>|3–7.89| = 4.89</li><li>|8–7.89| = 0.11</li><li>|8–7.89| = 0.11</li><li>|8–7.89| = 0.11</li><li>|8–7.89| = 0.11</li><li>|9–7.89| = 1.11</li><li>|9–7.89| = 1.11</li><li>|9–7.89| = 1.11</li><li>|9–7.89| = 1.11</li></ul><p>Or we can easily do calculations in excel too</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*P7bmvrPuLC494cAT3Y3qvg.png" /></figure><p>3. Add up all of the values you found in Step 2 i.e. Absolute Deviation values</p><p>4.89+0.11+0.11+0.11+0.11+1.11+1.11+1.11+1.11= 9.77</p><p>4. Now in this final step we will calculate Average of absolute Deviation</p><pre>=  (Total Absolute Deviation/ Total no of element)<br>= (9.77/9)<br>=1.085</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F5UqXb81xtM19cCzYMLeNA.png" /></figure><p>The average deviation is 1.09.</p><p>There are many ready made functions in excel through which we can do easily statistical operations, but yes before using we should have fundamental idea that why, how and where it will use.</p><h3><strong>How to calculate using Excel</strong>-</h3><p>AveDev () formula is used to calculate Average Deviation in excel which is ready to use without manual calculations, but yes again I am pointing that we should be conceptually strong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*ZmjOEb1H99S1x-LpZ0SQjw.png" /></figure><p>Press enter after putting formula in excel by selecting data points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/1*Aho3bB0jG-14wMOqwKP6gA.png" /></figure><h3>How to calculate using Python-</h3><pre># import pandas module  <br>import pandas as pd  <br>    <br># import numpy module  <br>import numpy as np  <br>    <br># creating list <br>list =[3,8,8,8,8,9,9,9,9] <br>  <br># create series <br>series = pd.Series(list)</pre><pre># call .mad() method to calculate Mean Absolute Deviation <br>result = series.mad() <br>  <br># display <br>print(result)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*0z9D5v59vSa6gBBBWw8xWQ.png" /></figure><p>Key Notes to remember things-</p><p><strong>Step 1:</strong> Calculate the mean.</p><p><strong>Step 2:</strong> Calculate how far away each data point is from the mean using positive distances. These are called absolute deviations.</p><p><strong>Step 3:</strong> Add those deviations together.</p><p><strong>Step 4:</strong> Divide the sum by the number of data points.</p><p>Following these steps in the example below is probably the best way to learn about mean absolute deviation, but here is a more formal way to write the steps in a formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/297/1*ie73kVPTRwyZdAnAPefzPQ.png" /></figure><h3>Mean absolute deviation (MAD) and why it is needed?</h3><p>Hope !! everyone may have enjoyed this post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=776d38d739e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are you ready to board in Elastic Search boat with fancy Kibana curtains using Python?]]></title>
            <link>https://amrita-msdn.medium.com/are-you-ready-to-board-in-elastic-search-boat-with-fancy-kibana-curtains-using-python-9a5baf721e39?source=rss-d3cac6ee7144------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a5baf721e39</guid>
            <category><![CDATA[kibana]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <dc:creator><![CDATA[amrita.msdn@gmail.com]]></dc:creator>
            <pubDate>Tue, 15 Sep 2020 12:47:29 GMT</pubDate>
            <atom:updated>2020-10-30T08:03:25.506Z</atom:updated>
            <content:encoded><![CDATA[<p>After reading this blog I am sure elastic search will not be unknown for you and also not be a fear factor any more though it is a vast topic so ideally not possible to cover in one blog, but I will try to introduce you at-least a full shot of end to end implementation. My purpose to write this blog to quickly know how to set up Elastic Search and Kibana, how to push data into Elastic search, and how to show data in Kibana.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*DUXUlOBJnj8ILbdtknRdtg.png" /></figure><p><strong>Short Introduction about Elastic Search and Kibana: </strong>Both are Completely open source and built with Java and the almost complete readymade solution starts with storing data to displaying data.</p><p><strong>Elasticsearch</strong> is a NoSQL <strong>database</strong>. That means it stores data in an unstructured way and that you cannot use SQL to query it. It works on restful API and almost any action can be performed using a simple restful API using JSON over HTTP.</p><p><strong>Kibana</strong> is used as front end application that works on top of the Elastic search stalk. It basically used as a charting and reporting tool. You can think like that we have put everything in Elastic search named pot and now whatever data you need to showcase in different forms (google maps, tables, charts, etc) for reporting purpose or analytics purpose can use it and even have full flexibility to search anything which exists in your data as elastic search build on top of Apache Lucene (most popular java-based search index based framework)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*9Q5w5gZM6GsXl7bjr3CtBQ.png" /></figure><p>By applying filters, you can dynamically showcase your data in different forms.</p><blockquote><strong>Why Need Elastic search and which companies are using it in currently?</strong></blockquote><ol><li>It is open source</li><li>It is distributed so easy to scale.</li><li>Support for advance search feature (Full text)</li><li>Excellent query(DSL)</li><li>Configurable and extensible</li><li>Document oriented</li><li>Schema free</li></ol><p><strong><em>Big market players are using ELastic search -</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4P1CgXGG5AcwEMWoMItTeQ.png" /></figure><blockquote><strong>Steps of installation:</strong></blockquote><ol><li>Download zip file for elasticsearch and Kibana from below web site (https://www.elastic.co/downloads/)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ad5-Ugh2nYnPwXrwXF23aw.png" /></figure><p>2. Unzip the folder on your local directory.</p><p>3. Go to terminal/console reach to Elasticsearch folder in your machine and run the command ./elasticsearch and enter like below screenshot-</p><p>Note: For Mac /.elasticsearch or ./kibana and for windows pls run elasticsearch.bat and kibana.bat</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*icoMC33ITPGB93UOmt5FIA.png" /></figure><p>4. Similarly, reach to kibana bin folder and run ./kibana command and enter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*Oq9-AT6h8WKLoVDuKZJ1Kg.png" /></figure><p>5. Now you don’t need to do anything both servers are up by only 2 simple steps. You just need to go on the browser and check if both servers are running <a href="http://localhost:5601/">http://localhost:9200/</a> for Elasticsearch and <a href="http://localhost:5601/">http://localhost:5601/</a> for Kibana. Waoo I m so happy both are running well :)..Hey!! Buddies are you with me till now..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NSP6f5vedRCY1Wur5Wl6ug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*58vMuLwsWCeVvFhegIAjlA.png" /></figure><h3><strong>Are you excited guys to push your first data with me into elasticsearch ?</strong></h3><p>In this example I am not connecting to any database to extract data otherwise this blog becomes boring for you to read and my agenda is really not to bore you.. Just wish to show you full movie in short steps not like an art movie….:)</p><p>After reading this blog I am sure Elastic search will not any more a fear factor as I will give explain with full end to end implementation with code examples..</p><p>So for practical example, please download some sample data from google which may have some sales data with date range.As a sample, I am taking second-hand car data which we will use to demonstrate its price based on its variants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZFkPA_RmYGyR_keKlaubQ.png" /></figure><h3><strong><em>Python code to push data in elastic search:</em></strong></h3><p>Import these package for elasticsearch and pandas in your python code-</p><pre>import pandas as pd<br>from elasticsearch import Elasticsearch<br>from elasticsearch import helper</pre><p>2. Let’s try to connect your running elasticsearch server-</p><pre># connect to elastic search<br>ES_HOST=”localhost”<br>es_client = Elasticsearch([{‘host’: ES_HOST, ‘port’: 9200}],http_compress=True)</pre><pre>if es_client.ping():<br> print(‘Connected’)<br>else:<br> print(‘Could not connect!’)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0aBVS6lLAPXfoXz-Kw4MhQ.png" /></figure><p>3. Now create an index which is nothing but a database name in a traditional relational database. If you really noticed I have created a shard in below code which is actually an instance of Lucene and it is a low level ‘worker’ which will be managed automatically by elasticsearch. An index is a logical namespace that points to shards.</p><pre># To create index<br>def createIndex(INDEX_NAME):<br> if not(es_client.indices.exists(INDEX_NAME)):<br> settings={“settings”:{“number_of_shards”:1,”number_of_replicas”:0}}<br> es_client.indices.create(INDEX_NAME,body=settings)<br> print(“Created: “+INDEX_NAME,es_client.indices.exists(INDEX_NAME)) <br> else:<br> print(INDEX_NAME, “index already exists!”)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4nMqOqXdVeHIuhQ89HVPw.png" /></figure><p>4. This step is very important where we actually map our recently created index with the columns available in our data with their data types so that Kibana can understand which column belongs to which data type.</p><pre>CAR_DOC =”car-doc”</pre><pre>def createCarDataMapping(INDEX_NAME):<br> if str(es_client.indices.get_mapping(INDEX_NAME))==”{‘“+ INDEX_NAME+”’: {‘mappings’: {}}}”:<br> es_client.indices.put_mapping(<br> include_type_name=True,<br> index = INDEX_NAME,<br> doc_type=CAR_DOC,<br> body={<br> “properties”: <br> {<br> “make”: {“type”: “keyword”},<br> “model”: {“type”: “keyword”},<br> “carversion”: {“type”: “keyword”},<br> “body_style”: {“type”: “keyword”},<br> “fuel_type”: {“type”: “keyword”},<br> “transmission”: {“type”: “keyword”},<br> “km_travelled”: {“type”: “integer”},<br> “listing_price”: {“type”: “integer”},<br> “colour”: {“type”: “keyword”},<br> “myear”: {“type”: “date”,”format”:”yyyy-MM-dd”}<br> }<br> } <br> )</pre><p>Now call the function</p><pre>createCarDataMapping(INDEX_CAR_SALE)</pre><h3><strong><em>Interesting point :</em></strong></h3><p>Friends, I am sharing my troubleshoots too with you, while writing this blog I was doing all steps for my sample example so that I can put the practical things in this post and code thrown an exception while calling the above function due to that I was unable to map the index. The exception was “TransportError(403, u’cluster_block_exception’, unblocked by: [FORBIDDEN/12/index read-only / allow delete (api)];’)” and it occurs due to low disk space.</p><p>Actually , Elasticsearch automatically sets &quot;read_only_allow_delete&quot;: &quot;true&quot; when hard disk space is low, so I have cleaned up my system to free some extra space as elastic search writes documents on your machine so logically it needs space to write and secondly I have checked the “read_only_allow_delete” property on browser — <a href="http://localhost:9200/old-car-sales/_settings">http://localhost:9200/old-car-sales/_settings</a> and found “read_only_allow_delete” = true too so after cleaning process I have set it back to false by using below code.</p><pre>import json<br>import urllib3</pre><pre>http = urllib3.PoolManager()</pre><pre>data = {‘index.blocks.read_only_allow_delete’: ‘false’}<br>encoded_data = json.dumps(data).encode(‘utf-8’)<br>r = http.request(<br> ‘PUT’,<br> ‘<a href="http://localhost:9200/old-car-sales/_settings&#39;">http://localhost:9200/old-car-sales/_settings&#39;</a>,<br> body=encoded_data,<br> headers={‘Content-Type’: ‘application/json’}<br> )</pre><pre>print(r.status)<br>print(r.reason)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fXxF_SBV_mnNT9JaRjbntQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XrHVpGDex4qGQkaAVquqzA.png" /></figure><blockquote>If you may also face similar issue then my experience can be useful for you and like me you don’t need to take many coffee breaks ;) to resolve this issue..</blockquote><p>5. Now copy the data which you wish to push in elastic search( you can also pull from any source like DB/jsonfile/excel). I have copied few columns and rows from my sample sheet — old-car-data.xlxs</p><p>In below line of code , pd is the object of pandas library in python and ,read_clipboard()function will read the copied rows from cliepboard and hold in dataframe with schema.</p><pre>dfCopied = pd.read_clipboard()<br>dfCopied</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbczEKmjqVRn8FWuIKuhRQ.png" /></figure><p>6. Next step is to create a document when we finished all preparation and now we are in a state to create a document.</p><p>Define the your columns and push the data which is hold in dataframe named — dfCopied</p><pre>def filterKeys(document,use_these_keys):<br>    return {key: document[key] for key in use_these_keys }</pre><pre>def doc_generator(df,INDEX_NAME,DOC_TYPE,KEYS):<br>    print(&quot;keys passed in doc_generator: &quot;)<br>    df_iter = df.iterrows()<br>    for index, document in df_iter:<br>        yield {<br>                &quot;_index&quot;: INDEX_NAME,<br>                &quot;_type&quot;: DOC_TYPE,<br>                #&quot;_id&quot; : f&quot;{document[&#39;id&#39;]}&quot;,<br>                &quot;_source&quot;: filterKeys(document,KEYS),<br>            }</pre><pre>CAR_COLUMNS =[‘make’,’model’,’carversion’,’body_style’,’fuel_type’,’transmission’,’km_travelled’,’listing_price’,’colour’,’myear’]</pre><pre>helpers.bulk(es_client, doc_generator(dfCopied,INDEX_DAILY_SG_SALE,DOC_TYPE_DAILY,CAR_COLUMNS))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ga3ryXfwXZjlPumi4edJbw.png" /></figure><p>Yeah!! 29 rows are successfully pushed in elasticsearch…</p><p>Now it’s time to Showcase our data … tell me where ???? Obviously Guys in Kibana :)</p><ol><li>So go to browser and run your Kibana -<a href="http://localhost:5601/">http://localhost:5601/</a> and now go to settings in left panel &gt;Elasticsearch&gt;Index Management and now you can see the Index which you have created through code above, is showing in kibana with no of documents we have pushed i.e. 29 ,documents means 29 records we have pushed as of now.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mfnicb0PFby6GSscCdP6NQ.png" /></figure><p>2.Now you need to create a index pattern which will actually mapped with your index columns.. Kibana&gt;Index Patterns&gt;create Index pattern</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fbmeZKeTl1FoHcvtQ2ZZQg.png" /></figure><p>3. Search your index &gt;next step</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mi20SPT3mqBc95GnBhGzUA.png" /></figure><p>4. Select the column name in step 2&gt; click on ‘Create index pattern’ button in bottom</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QR615D8e6gEmXg_FlO-Zg.png" /></figure><p>After creating index pattern you will be able to see the below screenshot where will have all columns information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*59WsxG2e7NGe9HxRZa-iIg.png" /></figure><p>5.From ‘discover’ option you can see your pushed data in elasticsearch</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4uJjDygV3UWmNFf5dc1xIA.png" /></figure><h3><strong>Now its time to showcase your data, so create a dashboard:</strong></h3><ol><li>Goto Kibana&gt;Dashboard&gt;create New and choose an option of your choice in which you wish to showcase your data from visualization panel</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*z_1CUONC6nE2agGWwxSL6w.png" /></figure><p>and I have chosen Data Table type and set the columns by choosing terms from the below options and saved it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UTrIwoZVExj-9C-YhuF_hQ.png" /></figure><p>2. I will show one more way to show data in this post which is of chart type, through Pie chart I will show the price based on the color variant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffNy1qJUBKBThSU-Psq2hw.png" /></figure><p>Now put these visuals elements on the dashboard which will change on the fly by changing filters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TXhomWQKvO1s5JPpYkBYIw.png" /></figure><p>Now your dashboard is ready to give presentations to your business team who can easily understand even without technical background too.. Hope you may enjoy this blog as now you are in state to create your own dashboard. For any query you can reach to me on — amrita.msdn@gmail.com.</p><p>Thanks for your patience to walk with me in this post..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a5baf721e39" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>