<?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[KYap - Medium]]></title>
        <description><![CDATA[Writing about things I’ve learnt - Medium]]></description>
        <link>https://medium.com/keith-yap?source=rss----7f5193cc8d99---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>KYap - Medium</title>
            <link>https://medium.com/keith-yap?source=rss----7f5193cc8d99---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:23:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/keith-yap" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Data visualisation with Python and Plotly: The Perth real estate market]]></title>
            <link>https://medium.com/keith-yap/data-visualisation-with-python-and-plotly-the-perth-real-estate-market-b99aba40071c?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/b99aba40071c</guid>
            <category><![CDATA[real-estate]]></category>
            <category><![CDATA[plotly]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[keith-yap]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Tue, 31 Oct 2017 14:01:53 GMT</pubDate>
            <atom:updated>2017-10-31T14:16:44.644Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*oNI3iI28J6J88RWWkqFlWA.png" /></figure><p>Python is well known for its data science and analysis capabilities with packages such as <a href="http://www.numpy.org/">Numpy</a>, <a href="https://matplotlib.org/">Matplotlib</a> and <a href="http://pandas.pydata.org/">Pandas</a>. Each of these packages also offer a variety of graphing and visualisation tools, the majority of which are already very well documented.</p><p>Recently, there has been a spate of new visualisation focused packages, some which have been well received and documented, and others, less so. <a href="https://plot.ly/">Plotly</a>, which we will explore in this post, is one of the latter ones.</p><p>For this exercise, we will use real-world real estate data of sold properties in the city of Perth, Western Australia. We will use our data to investigate the ever popular question — ‘What is the current state of the market in July 2017?’</p><p>The general steps in this exercise were:</p><ol><li>Data is scraped from real estate listing websites using a scraper built in Python using BeautifulSoup over a period of time</li><li>Data is stored in a PostgreSQL database that can be added to over time</li><li>For analysis, the database is exported to a Jupyter Notebook which serves as a working environment</li><li>The plotly package is installed in the Jupyter Notebook</li><li>Analysis using plotly is carried out, as per the below</li></ol><p>To set some context, our data set looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/520/0*dWC4U_Mu5azWXFpI.png" /></figure><p>Let’s start off by exporting our data out from the PSQL database. While Jupyter Notebook has the ability to link directly to the database, for simplicity we will export a static CSV that we will upload to our notebook.</p><pre>psql: \copy tablename to &#39;filename&#39; csv;</pre><p>We then upload the CSV file to the server that hosts the notebook, and initialise the notebook with the relevant packages</p><pre>import pandas as pd<br>import numpy as np<br>import plotly<br>import plotly.plotly as py<br>from plotly.graph_objs import *<br>import plotly.figure_factory as ff<br>plotly.offline.init_notebook_mode(connected=True)</pre><pre>df = pd.read_csv(&quot;file_location&quot;)</pre><pre>df.head()</pre><p>For our first attempt, a simple property value over time bar chart.</p><pre># group dates by week<br>df.Date = pd.to_datetime(df.Date) - pd.to_timedelta(7, unit=&#39;d&#39;)<br>df = df.groupby([pd.Grouper(key=&#39;Date&#39;, freq=&#39;W-MON&#39;), &#39;Price&#39;])[&#39;Type&#39;].count()<br>df = df.reset_index()</pre><pre># initialise bar chart using Plotly offline mode<br>data = [Bar(x=df.Date,<br>            y=df.Price)]<br>plotly.offline.iplot(data, filename=&#39;jupyter/basic_bar&#39;)</pre><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Ekptyap%2F1%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Ekptyap%2F1.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3454a35053f398c3496a3b8dfbceae89/href">https://medium.com/media/3454a35053f398c3496a3b8dfbceae89/href</a></iframe><p>Let’s try something a little more complex. A nice heatmap delving further into the types of properties being sold.</p><pre># group data by number of bedrooms per week<br>df = df.groupby([&#39;Bed&#39;, pd.Grouper(key=&#39;Date&#39;, freq=&#39;W-MON&#39;)])[&#39;Type&#39;].count()<br>df = df.reset_index()</pre><pre># intialise heatmap<br>import plotly.graph_objs as go</pre><pre>data = [<br>    go.Heatmap(<br>    z=df.Type,<br>    x=df.Date,<br>    y=df.Bed<br>    )<br>]</pre><pre>layout = go.Layout(<br>    title=&#39;Perth properties sold by number of bedrooms (May - Jul 2017)&#39;,<br>    yaxis = dict(<br>        title=&#39;Number of beds&#39;<br>        ),<br>    xaxis = dict(<br>        title=&#39;Date sold&#39;<br>        )<br>    )<br>fig = go.Figure(data=data, layout=layout)<br>plotly.offline.iplot(fig, filename=&#39;datetime-heatmap&#39;)</pre><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Ekptyap%2F3%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Ekptyap%2F3.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/409ae218d2cf0cdc24cd3c8d86f14a0e/href">https://medium.com/media/409ae218d2cf0cdc24cd3c8d86f14a0e/href</a></iframe><p>From this figure, we can see that 3 and 4 bedroom properties dominate the Perth market. We can also see sales volume dropping off towards the end of the month.</p><p>This is just the tip of the iceberg in terms of what Plotly can offer. It will be interesting to see where it lands amongst all the other visualisation tools in the market.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b99aba40071c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/data-visualisation-with-python-and-plotly-the-perth-real-estate-market-b99aba40071c">Data visualisation with Python and Plotly: The Perth real estate market</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[House Purchase Calculator — WA]]></title>
            <link>https://medium.com/keith-yap/house-purchase-calculator-wa-932de9180863?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/932de9180863</guid>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Fri, 07 Jul 2017 13:22:10 GMT</pubDate>
            <atom:updated>2017-10-31T13:51:42.212Z</atom:updated>
            <content:encoded><![CDATA[<p>The below spreadsheet can be used to check key metrics before purchasing a property.</p><p>All cells in orange are to be filled in with your own values. Everything else is calculated.</p><p><a href="https://onedrive.live.com/embed?cid=5E1CF6FEDA2D3A63&amp;resid=5E1CF6FEDA2D3A63%2111182&amp;authkey=AI9PZjuBzeINXlM&amp;em=2&amp;wdAllowInteractivity=False&amp;AllowTyping=True&amp;ActiveCell=&#39;Main&#39;!B1&amp;wdHideGridlines=True&amp;wdHideHeaders=True&amp;wdDownloadButton=True">https://onedrive.live.com/embed?cid=5E1CF6FEDA2D3A63&amp;resid=5E1CF6FEDA2D3A63%2111182&amp;authkey=AI9PZjuBzeINXlM&amp;em=2&amp;wdAllowInteractivity=False&amp;AllowTyping=True&amp;ActiveCell=&#39;Main&#39;!B1&amp;wdHideGridlines=True&amp;wdHideHeaders=True&amp;wdDownloadButton=True</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=932de9180863" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/house-purchase-calculator-wa-932de9180863">House Purchase Calculator — WA</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Thomas Jefferson — The Art of Power]]></title>
            <link>https://medium.com/keith-yap/thomas-jefferson-the-art-of-power-cdd1f7ba5f2?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/cdd1f7ba5f2</guid>
            <category><![CDATA[book-summary]]></category>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Sun, 25 Jun 2017 01:51:00 GMT</pubDate>
            <atom:updated>2017-10-31T13:51:43.162Z</atom:updated>
            <content:encoded><![CDATA[<p>The life of Jefferson highlighted, amongst other things — the thirst for knowledge, the capacity to create, the love of family and friends, the hunger for accomplishment, the applause of the world, the marshaling of power, the bending of others to one’s own vision.</p><h4>On Leadership and Politics</h4><ul><li>Philosopher’s think, politicians maneuver. Jefferson’s genius was that he was both and could do both, often simultaneously</li><li>Politics was informed by philosophy, but one could achieve the good only by putting philosophy into action</li><li>“If you meant to escape malice you should have confined yourself within the sleepy line of regular duty”</li><li>Rarely does one leave office with the reputation and goodwill that one had upon entering</li><li>“A person not sick will not be injured by getting wet…Brute animals are the most healthy and they are exposed to all weather”</li><li>Leadership meant knowing how to distill complexity into a comprehensible message to reach the hearts as well as the minds of the many</li><li>Politicians often talk too much and listen too little, which can be self defeating, for in many instances the surer route to winning a friend is not to convince them that you are right but that you care what they think</li></ul><h4>On hard work</h4><ul><li>Laziness was a sin — time spent at study was never wasted. “Knowledge indeed is a desirable, lovely possession”</li><li>“No other sure foundation can be devised for the preservation of freedom and happiness…as the diffusion of knowledge among the people</li></ul><h4>How he came to be</h4><ul><li>He came of age amid conflict, not certitude. To him statecraft was always a struggle between passionately held points of view.</li><li>Smooth marches of like minds to glorious conclusions may have been the stuff of his dreams, but reality was far from different — and it was reality that concerned him most.</li><li>He was both an unflinching political warrior and an easily wounded soul. He always would be.</li><li>He never had to raise his voice: Their sense of his authority was so complete that it was unnecessary.</li></ul><h4>On political manoeuvring</h4><ul><li>The Jefferson style — cultivate his elders, make himself pleasant to his contemporaries, and use his pen and his intellect to shape the debate — armed him well for the national arena</li><li>Settling differences with his peers or rivals over dinner — Tends to be more difficult to oppose someone with whom you have broken bread and drunk wine</li><li>Getting difficult bills that he drafted up himself to be presented by an ally, and then backing it up as if it wasn’t his idea in the first place</li><li>It was not an easy thing to do to defy George Washington but Jefferson’s subtlety enabled him to assert his own will against that of the president in such a seemingly gracious way that Washington was unable to counterattack.</li><li>The political Jefferson — a man who got his way quietly but unmistakably, without bluster or bombast, his words congenial but his will unwavering</li><li>He characteristically left himself a rhetorical escape by introducing the subjective standard of practicability</li><li>His conversational skill of speaking of topics of interest to his companion of the moment</li><li>When those were exhausted he would muse widely about the past and the future</li></ul><h4>Some personal points of view</h4><ul><li>Religion required careful thought, not reflexive acceptance. “Fix reason in her seat, and call to her tribunal every fact, every opinion. Question with boldness even the existence of a God; because, if there be one, he must more approve the homage of reason, than that of blindfolded fear”</li><li>Sometimes you do not need to strive for perfection — “He wrote beautifully of the pursuit of the perfect, but he knew good when he saw it. He would not make the two enemies.”</li><li>The power to tax was the most fundamental and far-reaching of all the powers of government (with the possible exception of war)</li><li>“That rare and charming egotism which can interest the listener in all one’s concerns”</li><li>War tends to lead to the fall of republics</li><li>Rendering moral judgments in retrospect can be hazardous</li></ul><h4>On debt</h4><ul><li>Odly, his innate sense of control and place may have enabled him to see debt as an abstract problem rather than a concrete one</li></ul><h4>On isolation</h4><ul><li>I remained closely at home, saw none but those who came there, and at length became very sensible of the ill effect it had upon my own mind, and of its direct and irresistible tendencey to render me unfit for society, and uneasy when necessarily engaged in it.</li><li>Withdrawing from the world leads to an antisocial and misanthropic sate of mind.</li></ul><h4>Of being a good host</h4><ul><li>The most fundamental duty is to show respect to those under one’s roof (eg. to transform an unnoticed guest into a person of importance)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdd1f7ba5f2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/thomas-jefferson-the-art-of-power-cdd1f7ba5f2">Thomas Jefferson — The Art of Power</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Command line apps]]></title>
            <link>https://medium.com/keith-yap/command-line-apps-515eaba29f23?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/515eaba29f23</guid>
            <category><![CDATA[apps]]></category>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Wed, 05 Apr 2017 13:55:35 GMT</pubDate>
            <atom:updated>2017-10-31T13:51:50.178Z</atom:updated>
            <content:encoded><![CDATA[<p>The following are apps I’ve developed that currently only run from the command line. Many thanks to the excellent <a href="http://cs50.tv/">CS50</a> course for guidance with these.</p><ul><li><a href="https://github.com/kptyap/kyap50/blob/master/pset2/caesar.c"><strong>Caesar</strong></a><strong> in C</strong> — Encrypts a user defined phrase using the <a href="https://en.wikipedia.org/wiki/Caesar_cipher">caesar cypher</a> method, and using a key that the user defines</li><li><a href="https://github.com/kptyap/kyap50/blob/master/pset2/vigenere.c"><strong>Vigenere</strong></a><strong> in C — </strong>Encrypts a user defined phrase using the <a href="https://en.wikipedia.org/wiki/Vigen%C3%A8re_cipher">vigenere cypher</a> method, and using a key that the user defines</li><li><a href="https://github.com/kptyap/kyap50/blob/master/pset6/crack2.py"><strong>Crack</strong></a><strong> in Python — </strong>Cracks a simple password that has been encrypted using the inbuilt <a href="https://en.wikipedia.org/wiki/Crypt_(C)">crypt function</a></li><li><a href="https://github.com/kptyap/kyap50/blob/master/pset3/fifteen/fifteen.c"><strong>Game of Fifteen</strong></a><strong> in C — </strong>Implements a playable version of the ‘<a href="https://en.wikipedia.org/wiki/15_puzzle">game of fifteen</a>’</li><li><a href="https://github.com/kptyap/kyap50/blob/master/pset4/bmp/resize.c"><strong>Resize</strong></a><strong> in C — </strong>resizes a BMP image by the proportion that the user defines</li><li><a href="https://github.com/kptyap/kyap50/blob/master/pset4/recover/recover.c"><strong>Recover</strong></a><strong> in C — </strong>recovers JPG images from a forensic image of a memory card</li><li><a href="https://github.com/kptyap/kyap50/blob/master/pset5/speller/speller.c"><strong>Speller</strong></a><strong> in C — </strong>a program that spell checks text files of any length, returning a list of misspelled words, utilising a trie memory structure for speed</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=515eaba29f23" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/command-line-apps-515eaba29f23">Command line apps</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 often forgotten rules of reporting dashboard design]]></title>
            <link>https://medium.com/keith-yap/3-often-forgotten-rules-of-reporting-dashboard-design-5ae60ff50ddc?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/5ae60ff50ddc</guid>
            <category><![CDATA[reporting]]></category>
            <category><![CDATA[keith-yap]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[dashboard]]></category>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Wed, 01 Mar 2017 13:37:38 GMT</pubDate>
            <atom:updated>2017-10-31T14:16:57.343Z</atom:updated>
            <content:encoded><![CDATA[<h4>A dashboard used to mean an array of physical instruments, arranged in front of an operator of some form of machine.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*ATjX_89ap8m4TOB3." /></figure><p>The meaning of the word <em>dashboard </em>has evolved over time<em>. </em>Now a <em>dashboard</em> is a term commonly used to refer to digital dashboards used for reporting.</p><figure><img alt="A digital dashboard in Microsoft’s Power BI software" src="https://cdn-images-1.medium.com/max/1024/0*w-ToYLwaLdfVYOJh.PNG" /><figcaption>A digital dashboard in Microsoft’s Power BI software</figcaption></figure><p>As digital dashboards have become more widespread, they have strayed further and further from the purpose and design principles of those original, physical dashboards. It is time to go back to basics. But what are the basics?</p><p>In the words of the master of dashboard design, Stephen Few:</p><blockquote>As dashboard is a visual display<br>of the most important information needed to achieve one or more objectives<br>consolidated and arranged on a single screen<br>so the information can be monitored at a glance.</blockquote><h4>1. Single page</h4><p>If your dashboard runs over a page, then it is no longer a dashboard but a <strong>report.</strong> Just as a driver of a car would not have to flick between dashboards just to check his speed, neither should readers of dashboards have to flick between pages to figure out what actions need to be taken.</p><h4>2. Make every pixel count</h4><p>In the design of a dashboard, less is always more. Question every <em>pixel </em>of ink on your dashboard and maximise the data/ink ratio wherever possible.</p><h4>3. Inform only to take action</h4><p>Dashboards should only exist to inform their users as to whether action needs to be taken, or not. Information that would not directly lead to action, no matter its status, should not be on a dashboard. This point should help achieve the first two points.</p><p>Yes, these are simple. Yet so many dashboard designs fail to meet these three criteria. Join us, and say “no” to bad dashboard design.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ae60ff50ddc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/3-often-forgotten-rules-of-reporting-dashboard-design-5ae60ff50ddc">3 often forgotten rules of reporting dashboard design</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Book Summary — Tuesdays with Morrie]]></title>
            <link>https://medium.com/keith-yap/a-book-summary-tuesdays-with-morrie-696e97015875?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/696e97015875</guid>
            <category><![CDATA[book-summary]]></category>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Mon, 30 Jan 2017 14:05:15 GMT</pubDate>
            <atom:updated>2017-10-31T14:14:26.430Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/243/0*rJBR91GOLuWHrYn4." /></figure><p>A young man reconnects with his old university mentor after more than 15 years. Unfortunately, his mentor, Morrie, is slowly dying of a fatal, degenerative disease. Rather than lapsing into self pity however, Morrie chooses to spend what time he has left coming to terms with his mortality. Shared in this memoir is his take on life from the unique perspective of one close to death.</p><h3>How to cope when the going gets tough</h3><h4>It is fine to feel sorry for yourself, but put a limit on it.</h4><p>“I don’t allow myself any more self pity than that. A little each morning. A few tears, and that’s all.” I thought about all the people I knew who spent many of their waking hours feeling sorry for themselves. How useful it would be to put a daily limit on self pity, just a few tearful minutes, then on with the day.</p><h4>Sometimes you have to trust your instinct</h4><p>Sometimes you cannot believe what you see, you have to believe what you feel. And if you are ever going to have other people trust you, you must feel that you can trust them too — even when you’re in the dark. Even when you’re falling.</p><h4>Learn how to detach.</h4><p>Take any emotion, for example love for a woman or grief for a loved one. If you hold back on the emotions — if you don’t allow yourself to go all the way through — then you can never get to being attached as you are too busy being afraid of the emotion. But by throwing yourself into these emotions, by allowing yourself to dive in, all the way, over your head even, you experience them fully and completely. You know what grief is. You know what love is. And only then can you say, “All right. I have experienced that emotion. I recognise it. Now I need to detach from that emotion for a moment.”</p><p>Same for loneliness: you let it go, let the tears flow, feel it completely — but eventually be able to say, “All right, that was my moment with loneliness. I’m not afraid of feeling lonely, but now I’m going to put that loneliness aside and know that there are other emotions in the world, and I’m going to experience them as well.”</p><h3>The failings of a modern, consumeristic culture</h3><h4>Don’t forget to take a step back and look at the big picture</h4><p>Our culture doesn’t encourage us to think about such things (what if today is my last day on earth) until you’re about to die. We are so wrapped up with egotistical things, career, family, having enough money, meeting the mortgage, getting a new car, fixing the radiator when it breaks — we are involved in trillions of little acts just to keep going. So we don’t get into the habit of standing back and looking at our lives and saying ‘Is this all? Is this all I want? Is something missing?’</p><h4>Love and kindness will make you richer than any number of things you could possibly buy</h4><p>You can’t substitute material things for love or for gentleness or for tenderness or for a sense of comradeship. Money nor power is a substitute for tenderness. I can tell you, as I sit here dying, when you most need it, money nor power will you the feeling you are looking for, no matter how much of them you have.</p><h3>On growing old</h3><h4>Growing old is inevitable, so learn to embrace it</h4><p>I embrace aging. As you grow, you learn more. If you stayed at twenty-two, you’d always be as ignorant as you were at twenty-two. Aging is not just decay, you know. It’s growth. It’s more than the negative that you are going to die, it’s also the positive that you understand you are going to die, and that you live a better life because of it. People who say “oh if I were young again” are a reflection of unsatisfied and unfulfilled lives. Lives that haven’t found meaning. Because if you’ve found meaning in your life, you don’t want to go back. You want to go forward.</p><h3>The meaning of life</h3><h4>Short answer: Love</h4><p>What are the important questions? They have to do with love, responsibility, spirituality, awareness. And if I were healthy today, those would still be my issues. They should have been all along. The most important thing in life is to learn how to give out love, and to let it come in. <em>Love is the only rational act.</em></p><p>The way you get meaning into your life is to devote yourself to loving others, devote yourself to your community around you, and devote yourself to creating something that gives you purpose and meaning.</p><p>Giving to other people is what makes me feel alive. Not my car or my house. Not what I look like in the mirror. When I give my time, when I can make someone smile after they were feeling sad, it’s as close to healthy as I ever feel. Do the kinds of things that come from the heart. When you do, you won’t be dissatisfied, you won’t be envious, you won’t be longing for somebody else’s things. On the contrary, you’ll be overwhelmed with what comes back.</p><h4>The extended answer: To best prepare for death</h4><p>Everybody knows they’re going to die, but nobody believes it. If we did, we would do things differently. We kid ourselves about death. The better approach is to know you are going to die and to be prepared for it at any time. That’s better. That way you can actually be more involved in your life while you are living.</p><p>Do what the Buddhists do. Every day, have a little bird on your shoulder that asks, “is today the day? Am I ready? Am I doing all I need to do? Am I being the person I want to be?”</p><p>Once you learn how to die, you learn how to live.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=696e97015875" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/a-book-summary-tuesdays-with-morrie-696e97015875">A Book Summary — Tuesdays with Morrie</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating data rows from a summary table — Reverse Pivot]]></title>
            <link>https://medium.com/keith-yap/creating-data-rows-from-a-summary-table-reverse-pivot-1a5f210c7176?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/1a5f210c7176</guid>
            <category><![CDATA[keith-yap]]></category>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Mon, 12 Dec 2016 14:11:29 GMT</pubDate>
            <atom:updated>2017-10-31T14:17:07.544Z</atom:updated>
            <content:encoded><![CDATA[<p>I needed to transform a table with data somewhat summarised (see below), back into a database, or data rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*XghDSCeN7Kf_c7Ut.png" /></figure><p>Thanks to <a href="http://sachachua.com/blog/2014/10/microsoft-excel-converting-summary-table-crosstab-back-data-rows/">the internet</a>, I uncovered this little trick.</p><ol><li>Press ALT + D + P to bring up the PivotChart wizard (Didn’t know this existed? Me neither.)</li><li>In the PivotTable dialog box, select the <strong>Multiple consolidation ranges</strong> option</li><li>In Step 2, choose the <strong>I will create the page fields</strong> option.</li><li>In Step 2b specify your summary table range in the <strong>Range</strong> field and then <strong>Add it</strong>.</li><li>Finish off the rest of the wizard</li><li>Select your newly created Pivot table and uncheck ‘Row’ and ‘Column’</li><li>Double click on the single value cell that is left.</li><li>Magic.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/0*xUtEnZp7BRyk87Xo.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a5f210c7176" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/creating-data-rows-from-a-summary-table-reverse-pivot-1a5f210c7176">Creating data rows from a summary table — Reverse Pivot</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rent vs Buy Calculator]]></title>
            <link>https://medium.com/keith-yap/rent-vs-buy-calculator-7557d9aa5a92?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/7557d9aa5a92</guid>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[finance]]></category>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Fri, 09 Dec 2016 09:20:27 GMT</pubDate>
            <atom:updated>2017-10-31T13:51:51.213Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple calculator to determine if you are financially better off to rent or buy a property. Feedback welcomed in the comments below.</p><p>Notes:</p><ul><li>this calculator has been tailored to the Australian market (eg. rent is expressed in weeks)</li><li>there are many ‘hidden’ costs of owning a property that have not been listed here to keep the calculator simple</li></ul><p><a href="https://jscalc.io/embed/BRc1q8g1n6tVhvge">{{view.title || &#39;JSCalc.io&#39;}}</a></p><p>Stamp duty can be obtained easily <a href="http://reiwa.com.au/advice/calculator-tools/stamp-duty-calculator-wa/">here</a>.</p><p>For those who really like the detail, a far more <a href="http://www.nytimes.com/interactive/2014/upshot/buy-rent-calculator.html">comprehensive calculator by the New York Times</a> is available.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7557d9aa5a92" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/rent-vs-buy-calculator-7557d9aa5a92">Rent vs Buy Calculator</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Select multiple items from a list in Excel]]></title>
            <link>https://medium.com/keith-yap/select-multiple-items-from-a-list-in-excel-fc6c121418d0?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/fc6c121418d0</guid>
            <category><![CDATA[keith-yap]]></category>
            <category><![CDATA[excel]]></category>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Sun, 27 Nov 2016 14:21:55 GMT</pubDate>
            <atom:updated>2017-10-31T14:17:19.763Z</atom:updated>
            <content:encoded><![CDATA[<p>For the rare occasion when you need to select multiple items from a list in Excel, the below VBA code will do the trick, complete with a nice selector panel. See the screen capture below for it in action.</p><figure><img alt="multiple-selector-excel" src="https://cdn-images-1.medium.com/max/640/0*4Nu_IF6xbgQ_P9pZ.gif" /></figure><p>This first code snippet should be placed in the worksheet where the multiple selection is needed. Replace the range with the range of cells in which the selection takes place (ie. clicking on any cell Q12 to Q30 will trigger the selector panel).</p><pre>Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count = 1 Then &#39;Range of cells to have the pop-up userform If Not Intersect(Range(&quot;Q12:Q30&quot;), Target) Is Nothing Then UserForm1.Show End If End If End Sub</pre><p>Next, create a new blank user form and add the below. Replace the range with the range of cells that contains the list of options that can be selected.</p><pre>Private Sub UserForm_Initialize()</pre><pre>With ListBox1<br> .MultiSelect = fmMultiSelectMulti<br> .ListStyle = fmListStyleOption<br> plist = Sheets(&quot;source ws&quot;).Range(&quot;A23:A100&quot;) //replace the range here<br> &#39;Filter Blanks<br> For i = LBound(plist) To UBound(plist)<br> If plist(i, 1) &lt;&gt; &quot;&quot; Then .AddItem Trim(plist(i, 1))<br> Next i<br> End With<br> End Sub</pre><pre>Private Sub UserForm_Activate()</pre><pre>&#39;Match Listbox selections with ActiveCell selections<br> Dim strCell As String, i As Long<br> strCell = ActiveCell.Value &amp; MySeperator<br> With ListBox1<br> For i = 0 To .ListCount - 1<br> .Selected(i) = InStr(1, strCell, .List(i), 1)<br> Next i<br> End With</pre><pre>UserForm1.Caption = &quot;Select Projects&quot;<br> CommandButton1.Caption = &quot;OK&quot;</pre><pre>End Sub<br> Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)<br> &#39;Hide userform if Close &quot;X&quot; clicked<br> If CloseMode = 0 Then<br> Cancel = True<br> Me.Hide<br> End If</pre><pre>End Sub<br> Private Sub CommandButton1_Click()</pre><pre>Dim i As Long, strTemp As String<br> With ListBox1<br> &#39;Read selections<br> For i = 0 To .ListCount - 1<br> If .Selected(i) Then<br> strTemp = strTemp &amp; .List(i) &amp; &quot;,&quot;<br> .Selected(i) = False &#39; Clear selections<br> End If<br> Next i<br> End With<br> If Len(strTemp) Then<br> strTemp = Left(strTemp, Len(strTemp) - Len(MySeperator))<br> ActiveCell.Value = strTemp<br> Else<br> ActiveCell.ClearContents<br> ActiveCell.Value = &quot;-- Select Project --&quot;<br> End If</pre><pre>UserForm1.Hide</pre><pre>End Sub<br>Unfortunately, there is no method to achieve this without the use of macros as of Excel 2016.</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc6c121418d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/select-multiple-items-from-a-list-in-excel-fc6c121418d0">Select multiple items from a list in Excel</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Text Analysis using Excel]]></title>
            <link>https://medium.com/keith-yap/text-analysis-using-excel-3d38b8f0c906?source=rss----7f5193cc8d99---4</link>
            <guid isPermaLink="false">https://medium.com/p/3d38b8f0c906</guid>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[text-analytics]]></category>
            <category><![CDATA[keith-yap]]></category>
            <category><![CDATA[sentiment-analysis]]></category>
            <dc:creator><![CDATA[Keith Yap]]></dc:creator>
            <pubDate>Sat, 26 Nov 2016 03:35:04 GMT</pubDate>
            <atom:updated>2017-11-15T12:21:25.996Z</atom:updated>
            <content:encoded><![CDATA[<h3>Text Analysis using Excel</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/0*9klb35tXjdaE6KuO." /></figure><blockquote>Below is a summary of my explorations using excel for text analysis. The example used in this article focuses on customer feedback for a hypothetical bank’s mobile app, however the methods described here could be used to analyse any body of text (or corpus) in excel.</blockquote><ul><li><a href="https://www.keithyap.com.au/text-analysis-using-excel#word-counts">Word Counts</a></li><li><a href="https://www.keithyap.com.au/text-analysis-using-excel/#word-clouds">Word Clouds</a></li><li><a href="https://www.keithyap.com.au/text-analysis-using-excel/#Sentence-counts">Sentence Counts</a></li><li><a href="https://www.keithyap.com.au/text-analysis-using-excel/#sentiment-analysis">Sentiment Analysis</a></li><li><a href="https://www.keithyap.com.au/text-analysis-using-excel/#topic-modelling">Topic Modelling</a></li><li><a href="https://www.keithyap.com.au/text-analysis-using-excel/#combine">Combining it all together</a></li></ul><p>There are plenty of companies out there that claim to offer complete end to end text analysis solutions to ‘help you uncover actionable insights from customer feedback’. These solutions tend to vary wildly in sophistication and usefulness, from the downright useless to the one or two that are at the cutting edge of text analysis. What they all have in common though, is that you will eventually need to pay to access their services. Most likely, you will also have to upload your customer feedback, which may be quite sensitive, onto their platforms and servers.</p><p>Fortunately, one is able to run decent text analysis from the comfort of excel. Below is a quick guide to the types of analysis you can run, ranging from easy to hard.</p><p>Before trying any of these, make sure your body of feedback has been spell checked. Customer written feedback is rarely without spelling or grammatical error.</p><h4>Word counts in excel (or very basic topic modelling)</h4><p>Simple word count of unique word occurrences can go a long way towards uncovering the overall themes in the text, once common words (eg. ‘a’, ‘the’, ‘is’, etc.) are removed.</p><ol><li>Split the body of text into single words (Consultant Robert Mundigl has made a <a href="http://www.clearlyandsimply.com/clearly_and_simply/2015/03/the-implementation-of-word-clouds-with-excel.html">handy macro </a>that does just this)</li><li>Count the number of each word occurrence using a Pivot Table. Select the column of single words and create a pivot table with the word column being in both ‘rows’ and ‘values’ of the pivot, then sort descending (if using Robert’s tool this is done for you).</li><li>Review the top word occurrences and discard common or superfluous words not that may cloud your analysis.</li></ol><p>Optional: It may then be helpful to create a simple bar chart to visually see the occurrences of words relative to each other.</p><figure><img alt="Word count results displayed in a bar chat is a quick way to derive insights from a body of text" src="https://cdn-images-1.medium.com/max/782/0*jQOlJc6WyMUARD2i.png" /><figcaption>Word count results displayed in a bar chart is a quick way to derive insights from a body of text</figcaption></figure><h4>Word clouds in Excel</h4><p>A word cloud is basically a fancy way to display a word count. In terms of actual usefulness for text analysis, a word count and associated bar chart is far more insightful. However, word clouds do look pretty. If you are set on creating a word cloud, consultant Robert Mundigl has created a <a href="http://www.clearlyandsimply.com/clearly_and_simply/2015/02/word-clouds-with-microsoft-excel.html">handy excel template and accompanying article</a> on how to do so.</p><h4>Sentence counts</h4><p>This can be a useful precursor to the sentiment analysis and topic modelling methods below. If your body of text is broken down sentence by sentence (eg. a body of survey responses) it may be useful to eliminate the responses that have too few words to be useful in analysis. The formula below returns the number of words in a cell (A1).</p><pre>=LEN(a1)-LEN(SUBSTITUTE(a1,&quot; &quot;,&quot;&quot;))+1</pre><p>You can then filter out all sentences below a certain word count.</p><figure><img alt="Screenshot of Filtering out any feedback less than 3 words in length as they do not add to our analysis and only create noise" src="https://cdn-images-1.medium.com/max/586/0*AM7Yh2ugIfShYKbe.png" /><figcaption>Filtering out any feedback less than 3 words in length as they do not add to our analysis and only creates noise</figcaption></figure><h4>Sentiment Analysis</h4><p>When we read a sentence, we can usually infer from the subjective information supplied what the sentiment, or mood, of that sentence is.</p><blockquote>Eg1. Your banking app is crap, I’ve seen other banks do better = negative</blockquote><blockquote>Eg2. The banking app does the job. Would like a chat option though = neutral</blockquote><blockquote>Eg3. Awesome! Love your app ever since the fingerprint login update= positive</blockquote><p>Sentiment analysis <strong>is</strong> possible in excel, albeit with a caveat — you need to have accompanying scores to go with your feedback. Let’s look at the examples again, this time with a numbered score next to each. The number is the rating that particular customer gave when providing their feedback; this could be in response to a quantitative question such as a 1–10 satisfaction or Net Promoter Score (<strong>NPS) </strong>question:</p><blockquote>Eg1. Your banking app is crap, I’ve seen other banks do better ~ 2</blockquote><blockquote>Eg2. The banking app does the job. Would like a chat option though ~ 5</blockquote><blockquote>Eg3. Awesome! Love your app ever since the fingerprint login update ~ 9</blockquote><p>Depending on how we wish to categorise customer sentiment, we can now do so by simply applying their number rating to their feedback.</p><figure><img alt="Screenshot of Feedback with sentiment derived from the previous quantitative question" src="https://cdn-images-1.medium.com/max/670/0*2MN8kxvs3yopcK34.png" /><figcaption>Feedback with sentiment derived from the previous quantitative question</figcaption></figure><p>In the example above, a nested IF statement is used to assign the ‘sentiment’ (or in this example, the <a href="https://www.netpromoter.com/know/">NPS category</a>) to each response:</p><pre>=IF(B1&gt;8,&quot;PROMOTER&quot;,IF(B1&gt;6,&quot;PASSIVE&quot;,&quot;DETRACTOR&quot;)))</pre><p>You are then free to categorise feedback by sentiment category.</p><figure><img alt="Screenshot of Using a pivot table we can filter all detractor comments to see which areas of improvement we should focus on" src="https://cdn-images-1.medium.com/max/613/0*80GH7N2ydz6S3RZx.png" /><figcaption>Using a pivot table we can filter all detractor comments to see which areas of improvement we should focus on</figcaption></figure><p>This method is by no means perfect; constructive feedback may be left even after a customer has given a low rating, and likewise a complaint may be made by the same customer who has given a high rating. However, from my experience it returns accurate results more than 80% of the time, <em>as long as the quantitative rating question is asked right before the open text feedback question.</em></p><p>True sentiment analysis derived purely from the text itself is unfortunately outside the capabilities of excel, to my knowledge. If your text is fairly linear, it may be possible to build up a library of sentiment triggering words and feed that into a large decision making macro to come up with a sentiment. Otherwise, the only alternative will be to use proper text analysis solutions.</p><h4>Theme / Topic modelling in excel</h4><p>When we read a sentence, we can usually infer from the subjective information and context supplied what the overall themes or topics are.</p><blockquote>Eg1. Your banking app is crap, I’ve seen others do better ~ ‘Competitors’, ‘App’</blockquote><blockquote>Eg2. The app does the job. Would like a live chat option though ~ ‘Chat’, ‘App’</blockquote><blockquote>Eg3. Awesome! Love your app ever since the fingerprint login update ~ ‘Fingerprint login’, ‘App’</blockquote><p>Topic modelling is a form of text mining to identify patterns and hence topics in a body of text without needing to read it; it is an entire area of linguistic research in its own right. And any online text analysis solution that can do this even partially well currently requires a powerful semantic and linguistic processing engine, backed up by extensive database of topics.</p><p>However, if you know your body of text well enough, and it is sufficiently narrow, topic modelling is possible in excel.</p><ol><li>Organise your feedback with individual responses on separate rows. If you have accompanying feedback scores, make sure these sit on the same row. This will be the <strong>Analysis </strong>sheet.</li><li>Set up the topics in a separate sheet. This will be the <strong>Topic Models</strong> sheet. The first row of the sheet should contain the individual topic titles. In each column, under each title, list out the words that correspond to the topic.</li></ol><figure><img alt="List of A simple topic model" src="https://cdn-images-1.medium.com/max/800/0*Bt61JwS6wrpMYgNb.png" /><figcaption>A simple topic model</figcaption></figure><p>3. Define each group, setting the title as the name for the group. Each of these will be a <strong>Topic Group.</strong></p><figure><img alt="Screenshot of Using excel&#39;s names feature to make topic groups" src="https://cdn-images-1.medium.com/max/769/0*V40YAKFBbDM7qMoO.png" /><figcaption>Use excel’s inbuilt Names feature to use as your Topic Groups. You can use either the ‘Define Name’ function (pictured) or the ‘Create from Selection’ function underneath. Both will achieve the same result.</figcaption></figure><p>3. Copy and paste the first row containing the topic titles into the Analysis sheet, alongside the feedback.</p><p>4. Command excel to take each response and match it against the topics which we have defined. If a word in a topic matches, then return the title of the Topic Group in each corresponding cell.</p><pre>=IF(SUMPRODUCT(--ISNUMBER(SEARCH(Topic Group,Feedback)))&gt;0,Title of Topic Group,&quot;&quot;))</pre><figure><img alt="Screenshot of the formula at work" src="https://cdn-images-1.medium.com/max/800/0*vvzwBMmShTXBB-Zh.png" /><figcaption>The formula at work matching the feedback to our pre-defined topic. Note the anchors ($) in the formula, this is necessary to copy the formula across and down.</figcaption></figure><p>In the example above, for cell E2:</p><pre>=IF(SUMPRODUCT( — ISNUMBER(SEARCH(NFC,$B2)))&gt;0,E$1,””)</pre><p>5. Copy the formula lengthways and down-ways (making sure to anchor the relevant cells correctly). Unfortunately you will need to manually edit the name of each Topic Group you call (or code a macro to automate this).</p><p>6. Summarise the calls at the bottom of your topic matrix.</p><p>7. Use pivot tables and graphs to present a nice summary. In the example below, we can instantly see that Quick Balance and NFC are the two major topics that our customers are talking about</p><figure><img alt="Example feedback for mobile app in excel" src="https://cdn-images-1.medium.com/max/800/0*mDBO72m2kZ9ora6L.png" /><figcaption>Our feedback can now be read at a glance</figcaption></figure><h4>Combining it all together</h4><p>By joining sentiment analysis and topic modelling, we can generate lists of topics important to our happy customers (promoters) or customers at risk of leaving (detractors). The below example uses the previously discussed sentiment grouping to add further insight to the feedback. You can now also use filters to sort and read feedback by topic groups.</p><figure><img alt="Filtering and sorting feedback graph" src="https://cdn-images-1.medium.com/max/800/0*EbGLOysixtsRsd4G.png" /><figcaption>Filtering for promoter feedback only, we can see that Quick Balance is the main feature that currently delights our customers.</figcaption></figure><p>The excel workbook used in this article is available for download on my <a href="https://www.keithyap.com.au/text-analysis-using-excel/">personal site</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d38b8f0c906" width="1" height="1" alt=""><hr><p><a href="https://medium.com/keith-yap/text-analysis-using-excel-3d38b8f0c906">Text Analysis using Excel</a> was originally published in <a href="https://medium.com/keith-yap">KYap</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>