<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kai Py</title>
    <description>The latest articles on DEV Community by Kai Py (@kaipy).</description>
    <link>https://dev.to/kaipy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F199235%2Fddd2f501-7d39-43eb-b105-7395d559a4d5.png</url>
      <title>DEV Community: Kai Py</title>
      <link>https://dev.to/kaipy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaipy"/>
    <language>en</language>
    <item>
      <title>Computing Daily Stock Market Returns in Python</title>
      <dc:creator>Kai Py</dc:creator>
      <pubDate>Sun, 17 Nov 2019 15:45:53 +0000</pubDate>
      <link>https://dev.to/kaipy/computing-daily-stock-market-returns-in-python-4dpc</link>
      <guid>https://dev.to/kaipy/computing-daily-stock-market-returns-in-python-4dpc</guid>
      <description>&lt;p&gt;Computing stock market returns in Python is simple. The first step is to import the required libraries.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import pandas as pd
import numpy as np
import datetime
import matplotlib.pyplot as plt
from pandas_datareader import data as pdr
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The next step is to get the stock data. I prefer to use yahoo as the source of my data. We use the get_data_yahoo method from the pandas_datareader library which has been imported as pdr. We also specify the start and end date using the datetime method. We will be getting the data for Apple. Therefore, all this is stored in the appl variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aapl = pdr.get_data_yahoo('AAPL', 
                          start=datetime.datetime(2006, 10, 1), 
                          end=datetime.datetime(2012, 1, 1))
daily_close = aapl[['Adj Close']]

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next is to get the returns. Firstly, we extract the daily close quote from the aapl data frame . Then, we apply the pct_change() method on daily_close and store it in the returns variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;returns = daily_close.pct_change()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Finally, we can apply the plot method on the returns variable to plot the returns of apple within the time frame&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;returns.plot()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>python</category>
      <category>finance</category>
    </item>
    <item>
      <title>Learning How To Learn </title>
      <dc:creator>Kai Py</dc:creator>
      <pubDate>Wed, 14 Aug 2019 15:48:03 +0000</pubDate>
      <link>https://dev.to/kaipy/learning-how-to-learn-okh</link>
      <guid>https://dev.to/kaipy/learning-how-to-learn-okh</guid>
      <description>&lt;p&gt;I've been privileged to study and interact with thought leaders in a few fields. From my experience, rep matters. Repetition. That's how you remember, that's how you learn, that's how you grow.&lt;/p&gt;

&lt;p&gt;Having said that, I believe every typical learning process follows three steps.&lt;/p&gt;

&lt;p&gt;1.WHAT: that's where you see for the first time. That's your 0-th moment of truth. That's the phase where you learn basic syntaxes and acronyms. For developers, that's the stage where you watch YouTube videos and read books. In this stage, the chances are high that you haven't started building. This defines the WHAT stage. The longer you delay the start of the first project or the beginning of a new one, the longer you remain in the WHAT stage.&lt;/p&gt;

&lt;p&gt;2.HOW: This is where you build. This is also the most misleading stage. The fact that you're completing projects has no correlation with understanding or mastery. Any smart person can build by trial and error. However, don't be deterred. The essence of this stage is for you to familiarise yourself with basic tools. This is where you start crafting your style. This is the most painful stage.&lt;/p&gt;

&lt;p&gt;3.WHY: This is the stage where you question existing bodies of knowledge. This is where you tear down frameworks and methodologies. This is where you invent your tools. This is not necessarily the teaching stage. Teaching can happen in the WHAT stage. Don't conflate the two.&lt;/p&gt;

&lt;p&gt;How do you get to the WHY stage?&lt;/p&gt;

&lt;p&gt;Rep. Repetition. Practice.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>devlive</category>
      <category>beginners</category>
      <category>career</category>
    </item>
  </channel>
</rss>
