<?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 Kirill Strelkov on Medium]]></title>
        <description><![CDATA[Stories by Kirill Strelkov on Medium]]></description>
        <link>https://medium.com/@kirillstrelkov?source=rss-35c531b585fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1Z87ff_yNrWhCx7r.</url>
            <title>Stories by Kirill Strelkov on Medium</title>
            <link>https://medium.com/@kirillstrelkov?source=rss-35c531b585fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 18:26:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kirillstrelkov/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[Stock prices analysis with Python]]></title>
            <link>https://kirillstrelkov.medium.com/stock-prices-analysis-with-python-20f233009e50?source=rss-35c531b585fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/20f233009e50</guid>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-visualization]]></category>
            <dc:creator><![CDATA[Kirill Strelkov]]></dc:creator>
            <pubDate>Wed, 12 May 2021 19:19:46 GMT</pubDate>
            <atom:updated>2021-05-14T18:09:19.503Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>This page contains analysis of S&amp;P500 stock prices with Python, collection of interesting findings and fun charts.</p><p><strong>This data is only for fun purpose and should not be used for as main criteria for buying/selling stocks.</strong></p><p>If you need more detailed analysis — check pdfs and Jupyter notebooks on my <a href="https://github.com/kirillstrelkov/playground/tree/master/stocks/buy_sell_analysis">GitHub</a>.</p><p>There will be two screenshots:</p><ul><li>first one is where <strong>all</strong> stock prices are compared with base price which is the <strong>first price in history</strong></li><li>second one is where stock prices are compared with base price which is <strong>first price within specific period</strong><em>(If we want to analyze weekdays then dataset is split into weeks/period and each Monday is base price for each week/period)</em></li></ul><h3>Which month do stock prices raise or fall in?</h3><p>Period: 10 years, 2011–01–01 to 2021–01–01</p><p>Code example<em>(If you need full code check GitHub link above):</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1d1rleLi8D_nMNTLly9f2A.png" /><figcaption>Jupyter code that processes data and generates charts</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*FOGlGBeVL7YRlMG_OWlljw.png" /><figcaption>Monthly stock price fluctuations, <strong>base price — first price in history</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*cW-9avY5b19IC1jYPg7qxg.png" /><figcaption>Monthly stock price fluctuations, <strong>base price — first price in period</strong></figcaption></figure><p>Stocks go down in April, May and September.</p><p>Stock go up in August, October, November and December</p><h3>Which week do stock prices raise or fall in?</h3><p>Period: 10 years, 2011–01–01 to 2021–01–01</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*vdk4DniOZJ9QUhalNbuw7g.png" /><figcaption>Weekly stock price fluctuations, <strong>base price — first price in history</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*9cgbva5ReW7oktTVdt5saw.png" /><figcaption>Weekly stock price fluctuations, <strong>base price — first price in period</strong></figcaption></figure><p>Stocks go down in weeks 22-23, 44, 52.</p><p>Stocks go up in weeks 7, 24, 46, 49</p><h3>Which weekday do stock prices raise or fall in?</h3><p>Period: 10 years, 2011–01–01 to 2021–01–01</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*gsDHrPnOFPWEDePQC6vPvA.png" /><figcaption>Weekday stock price fluctuations, <strong>base price — first price in history</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*tXivciU9Wpl68RnXNxd3xQ.png" /><figcaption>Weekday stock price fluctuations, <strong>base price — first price in period</strong></figcaption></figure><p>Stocks go down on Wednesdays.</p><p>Stocks go up unknown.</p><h3>Which day of a month do stock prices raise or fall in?</h3><p>Period: 10 years, 2011–01–01 to 2021–01–01</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*n4-vtWAq1f8Xnnp9aBuCuA.png" /><figcaption>Daily stock price fluctuations, <strong>base price — first price in history</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*ExTlxP8hp8-WvtBNSMVrPg.png" /><figcaption>Weekday stock price fluctuations, <strong>base price — first price in period</strong></figcaption></figure><p>Stocks go down on days 15, 23, 31.</p><p>Stocks go up on days 13, 20, 27, 30.</p><h3>Which hour of a day do stock prices raise or fall in?</h3><p>Period: 2019–06–01 to 2021–05–01 <em>(Yahoo Finance is limited to 2 year history for 1 hour interval)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*V2JjyWzJ-8V3BBiChPB-MA.png" /><figcaption>Hourly stock price fluctuations, <strong>base price — first price in history</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*QIQcarhTuKHJ2L-MNpejTg.png" /><figcaption>Hourly stock price fluctuations, <strong>base price — first price in period</strong></figcaption></figure><p>Stocks go down at 11, 14.</p><p>Stocks go up at 10, 13.</p><h3>Which time of a day do stock prices raise or fall in?</h3><p>Period: 2021–03–14 to 2021–05–11 <em>(Yahoo Finance is limited to 2 months history for 15 mins interval)</em></p><p><em>NOTE: 0.25 means 15 mins, 0.5 means 30 mins, 0.75 means 45 mins</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*jImwmuXsYwRK7L4W7yYpbg.png" /><figcaption>Stock price fluctuations within one day, <strong>base price — first in history</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*NQ2kauEoIuilYXmO2yMxVw.png" /><figcaption>Stock price fluctuations within one day, <strong>base price — first in period</strong></figcaption></figure><p>Stocks go down at 14:30.</p><p>Stocks go up at 12:45, 14:15, 15:00.</p><h3>Short summary</h3><p>You cannot predict prices and even strategy “<a href="https://en.wikipedia.org/wiki/Sell_in_May">Sell in May and go away</a>” seems to contradict to this analysis.</p><h3>Long summary</h3><p>Here is a table with summary of my findings:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f632e2b5f39a9e3d486f77192c21e503/href">https://medium.com/media/f632e2b5f39a9e3d486f77192c21e503/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20f233009e50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python profiling with VSCode]]></title>
            <link>https://kirillstrelkov.medium.com/python-profiling-with-vscode-3a17c0407833?source=rss-35c531b585fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a17c0407833</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[profile]]></category>
            <dc:creator><![CDATA[Kirill Strelkov]]></dc:creator>
            <pubDate>Fri, 16 Apr 2021 12:46:51 GMT</pubDate>
            <atom:updated>2025-03-23T12:05:40.420Z</atom:updated>
            <content:encoded><![CDATA[<p>Create launch configuration to run any Python file with profiler(./launch.json):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f986737005141c154fb9e391ff690647/href">https://medium.com/media/f986737005141c154fb9e391ff690647/href</a></iframe><p>See “Python: Current File with profiler” configuration. Here we are running cProfile module with our file ${file}out file is /tmp/tmp.prof</p><p>Open output file with snakeviz:</p><pre>snakeviz /tmp/tmp.prof</pre><p>You should be able to see profiled information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8yJhGYA5eP6SFw7SeFvjyA.png" /></figure><p>More about snakeviz can be found in previous post -<a href="https://medium.com/@kirillstrelkov/easy-python-profiling-a70cbf699295">https://medium.com/@kirillstrelkov/easy-python-profiling-a70cbf699295</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a17c0407833" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparing laptops’ performance with Ubuntu]]></title>
            <link>https://kirillstrelkov.medium.com/comparing-laptops-performance-with-ubuntu-d1f2320354bc?source=rss-35c531b585fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1f2320354bc</guid>
            <category><![CDATA[comparison]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[laptop]]></category>
            <category><![CDATA[benchmark]]></category>
            <dc:creator><![CDATA[Kirill Strelkov]]></dc:creator>
            <pubDate>Fri, 09 Oct 2020 14:32:36 GMT</pubDate>
            <atom:updated>2021-04-23T08:18:26.410Z</atom:updated>
            <content:encoded><![CDATA[<h3>Comparing laptops with Ubuntu</h3><p>Here are some points that should be considered when buying new laptop:</p><ul><li>CPU performance</li><li>CPU throttling</li><li>GPU performance</li><li>WiFi speed</li><li>Disk speed</li><li>Display(Specs, backlight bleeding)</li></ul><h3>Preconditions</h3><p>Install latest Ubuntu or use Ubuntu live CD/USB.</p><p>Use latest proprietary drivers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*Qi2SINe4N79UjRmhwTUfiA.png" /></figure><p>Use community-maintained software:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*U1wdyan7F5M2FqFkMZ-mOg.png" /></figure><h3>CPU performance</h3><p>User Geekbench 5 (<a href="https://www.geekbench.com/download/">https://www.geekbench.com/download/</a>) for CPU testing. <strong>NOTE</strong>: don’t forget to attach power cable and set max performance mode.</p><p>Result of Geekbench:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*exws-EWd2Nes44W-AkXWnQ.png" /><figcaption><a href="https://browser.geekbench.com/v5/cpu/4093785">https://browser.geekbench.com/v5/cpu/4093785</a></figcaption></figure><h3>CPU throttling</h3><p>CPU throttling might happen because of bad thermal regulations(CPU heats too much). Run next command simultaneously to get CPU frequencies for all threads.</p><pre>cd /tmp</pre><pre># Install packages:<br>sudo apt update<br>sudo apt install -y stress-ng glmark2</pre><pre>echo &quot;CPU throttling check:&quot;<br>export MAX_TIME=5m</pre><pre>stress-ng --cpu 0 --verify --verbose --timeout $MAX_TIME &amp; </pre><pre>timeout $MAX_TIME bash -c &#39;while true; do cat /proc/cpuinfo | grep &quot;cpu MHz&quot;; sleep 1; done &amp;&gt; /tmp/1.csv&#39;</pre><pre>sed -i -E &#39;s/.+:\s*//g&#39; /tmp/1.csv</pre><p>Now open /tmp/1.csv in LibreOffice and plot chart using data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*x9N-y2MA-0EB5v07kakTHw.png" /><figcaption>Chart example in Libreoffice</figcaption></figure><p>Check is there are drops in CPU frequencies. In example above you can see that after 200 points CPU drops to ~800 MHz — this is bad.</p><h3>GPU performance</h3><p>Use next commands:</p><pre>cd /tmp</pre><pre># Install packages:<br>sudo apt update<br>sudo apt install -y glmark2</pre><pre>echo &quot;GPU test:&quot;<br>glmark2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*BkRDR6CeNaVRtJh8oMbl7w.png" /><figcaption>Output example of glmark2</figcaption></figure><p><strong>NOTE: </strong>check that GL_RENDERER is a proper GPU card(discrete or integrated)</p><h3>WiFi speed</h3><p>Use <a href="https://www.speedtest.net/">https://www.speedtest.net/</a> for WiFi or Ethernet speed test.</p><h3>Disk speed</h3><p>Use built-it “Disks” tool and benchmark proper disk drive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*b2ai5d0SiVXw8RJ7QjBOUw.png" /><figcaption>Disk benchmark</figcaption></figure><h3>Display</h3><p>Check specification of your display(For Lenovo you can use <a href="https://psref.lenovo.com/">https://psref.lenovo.com/</a> to find data for your laptop). Look for resolution, panel type, refresh rate, brightness and sRGB/NTSC/Adobe RGB. Ideally display should have <strong>100% sRGB or ~72% NTSC or ~64% AdobeRGB </strong>and<strong> 300+ </strong>nits<strong>(</strong>cd/m²)<strong>.</strong></p><p>To check backlight bleeding use open <a href="https://www.youtube.com/watch?v=aXHcRiSK_ys">https://www.youtube.com/watch?v=aXHcRiSK_ys</a> and check if your display has “white spots”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lbiyj_WLZ3c508yV.jpg" /><figcaption>Example of backlight bleeding in Lenovo E14 Gen2 ~800 euros!!, taken from notebookcheck.net</figcaption></figure><h3>The script</h3><p>Script contains CPU throttling and GPU tests and ca be found here — <a href="https://bit.ly/33x2cpr">https://bit.ly/33x2cpr</a> or <a href="https://gist.github.com/kirillstrelkov/d739c7e073e9b7b871182c71a81a4308">https://gist.github.com/kirillstrelkov/d739c7e073e9b7b871182c71a81a4308</a></p><h3>Summary</h3><ol><li>Don’t trust any brands.</li><li>Check reviews from <a href="https://www.notebookcheck.net/">https://www.notebookcheck.net/</a> especially measured data. Check CPU — <a href="https://www.notebookcheck.net/Mobile-Processors-Benchmark-List.2436.0.html">https://www.notebookcheck.net/Mobile-Processors-Benchmark-List.2436.0.html</a>. Check GPU — <a href="https://www.notebookcheck.net/Mobile-Graphics-Cards-Benchmark-List.844.0.html">https://www.notebookcheck.net/Mobile-Graphics-Cards-Benchmark-List.844.0.html</a> or for Games — <a href="https://www.notebookcheck.net/Computer-Games-on-Laptop-Graphics-Cards.13849.0.html">https://www.notebookcheck.net/Computer-Games-on-Laptop-Graphics-Cards.13849.0.html</a></li><li><strong>Buy it, try it and return it if it doesn’t suit your needs.</strong></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1f2320354bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ryzen 4000 mobile Geekbench statistics]]></title>
            <link>https://kirillstrelkov.medium.com/ryzen-4000-mobile-geekbench-statistics-8f65d59d148c?source=rss-35c531b585fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f65d59d148c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[amd-mobile-cpu]]></category>
            <category><![CDATA[ryzen]]></category>
            <category><![CDATA[geekbench]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Kirill Strelkov]]></dc:creator>
            <pubDate>Mon, 21 Sep 2020 22:03:13 GMT</pubDate>
            <atom:updated>2020-09-23T21:43:55.672Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ryzen 4000 mobile CPUs Geekbench 5 statistics</h3><p>Note: when you see in text “average” i mean “mean”.</p><h3>Step 1: Get initial from Geekbench 5 for all Ryzen 4000 processors</h3><p>Script to fetch data from Geekbench can be found here — <a href="https://github.com/kirillstrelkov/playground/blob/master/geekbench/ryzen_stats.py">https://github.com/kirillstrelkov/playground/blob/master/geekbench/ryzen_stats.py</a></p><p>Excel file with all data is located here— <a href="https://github.com/kirillstrelkov/playground/blob/master/geekbench/result.xlsx">https://github.com/kirillstrelkov/playground/blob/master/geekbench/result.xlsx</a></p><h3>Step 2: Load data into Jupyter Notebook</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*1dCv9fq3DjNoGrKhE6WUwA.png" /><figcaption>Read excel and plot number of data points</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*ETHEl4qyCHyVo2vsmf52Vw.png" /><figcaption>Number of data points for each CPU and Platform</figcaption></figure><h3>Step 3: Plot chart for Single-Core Score</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*ueg3nP7y9wlnZxwjQyKcYA.png" /><figcaption>Group by CPU, Laptop Model and Platform+ hack to fix ordering in plots</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*pp0lr905g46YsJI1a8y9nA.png" /><figcaption>Group by CPU and Platform + Plot Single-Score Score</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*nNk0uixabIuons4LxdE1mA.png" /><figcaption>Mean Single-Core Score per CPU</figcaption></figure><h3>Step 4: Plot chart for Multi-Core Score</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*2jFVY8pZJ8b8EmlZtc8GLw.png" /><figcaption>Plot Multi-Core Score</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*yLTX4vsdDD7AVQ26Ruv9aQ.png" /><figcaption>Mean Multi-Core Score per CPU</figcaption></figure><h3>Step 4: Plot chart for “Total” Score and order by it</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*nRWsZgpGqQpSfmNDMgjD0g.png" /><figcaption>Sum Multi-Core Score and Single-Core Score and get average “Total” score for Windows</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*UufEgzuN4W1gKpSpqeJQBQ.png" /><figcaption>Plot for lowest to highest “Total” Scores</figcaption></figure><p>Interesting findings:</p><ul><li><strong>H</strong>≈<strong>HS</strong>:<strong> </strong>‘HS’ processors don’t have better score than ‘H’ processors</li><li><strong>4500U &gt; 4600U</strong>: 4500U has better score than 4600U — this might be due to lower number of data points for 4600U(4500U ~1800 data points, 4600u ~250 data points)</li><li><strong>4700U ≈ 4600H ≈ 4600HS</strong>: Although 4600H and 4600HS have 12 theards vs 8 threads of 4700U, more threads don’t give big boost in Multi-Core Score</li><li><strong>Windows &gt; Linux</strong>: Windows scores are higher than Linux scores in most cases</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f65d59d148c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do stock prices go down on Fridays?]]></title>
            <link>https://kirillstrelkov.medium.com/do-stock-prices-go-down-on-fridays-2d9130cbf4fb?source=rss-35c531b585fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d9130cbf4fb</guid>
            <category><![CDATA[analysis]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[sp500]]></category>
            <category><![CDATA[stock-market]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Kirill Strelkov]]></dc:creator>
            <pubDate>Fri, 28 Aug 2020 15:36:34 GMT</pubDate>
            <atom:updated>2020-08-28T17:07:44.841Z</atom:updated>
            <content:encoded><![CDATA[<p>It seems that stock prices have tendency to go up on Mondays and go down Friday. Here is quick analysis of S&amp;P500 weekday prices from 2015 to 2020.</p><h3>Getting S&amp;P 500 data</h3><pre>import pandas as pd</pre><pre>import yfinance as yf<br>import os<br>from pandas.core.frame import DataFrame<br>from more_itertools.recipes import flatten</pre><pre># Save csv file from <br># <a href="https://datahub.io/core/s-and-p-500-companies">https://datahub.io/core/s-and-p-500-companies</a> to &#39;sp500.csv&#39;<br>df = pd.read_csv(&quot;stocks/week/sp500.csv&quot;)<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*ybMlHLfgBn_fdh6MAo816w.png" /><figcaption>First 5 rows of S&amp;P companies</figcaption></figure><h3>Step 2: Get stock price histories for 2015–2020</h3><pre>START_DATE = &quot;2015-08-28&quot;<br>END_DATE = &quot;2020-08-28&quot;</pre><pre>def get_history(symbol):<br>    ticker = yf.Ticker(symbol)<br>    df = ticker.history(period=&quot;1d&quot;, start=START_DATE, end=END_DATE)<br>    if not df.empty:<br>        df[&quot;Symbol&quot;] = symbol<br>    return df</pre><pre>get_history(df[&quot;Symbol&quot;][0]).head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*iVEU7kx_ZphXyJitC5TTPw.png" /><figcaption>First 5 days of stock prices for MMM</figcaption></figure><h3>Step 3: Get differences between Monday and other weekday</h3><pre>def get_weekly_diffs(df):<br>    symbol = df[&quot;Symbol&quot;][0]<br>    df = df.reset_index()<br>    df[&quot;weekday&quot;] = df[&quot;Date&quot;].apply(lambda x: x.weekday())</pre><pre>    if df[df[&quot;weekday&quot;] == 0].empty:<br>        return {}</pre><pre>    # getting first row that starts with Monday<br>    df = df[df[df[&quot;weekday&quot;] == 0].index[0] :]<br>    prev_monday_price = 0<br>    full_weeks = []<br>    is_monday = False<br>    is_friday = False<br>    week = []<br>    for _, row in df.iterrows():<br>        weekday = row[&quot;weekday&quot;]<br>        # filter weeks were all days were traiding days<br>        is_monday = weekday == 0<br>        is_friday = weekday == 4</pre><pre>        if is_monday:<br>            prev_monday_price = row[&quot;Open&quot;]<br>            price_diff = 1<br>            week = [row]<br>        else:<br>            if prev_monday_price == 0:<br>                continue<br>            price_diff = row[&quot;Open&quot;] / prev_monday_price<br>            week.append(row)<br>        row[&quot;diff&quot;] = price_diff</pre><pre>        if is_friday and len(week) == 5:<br>            full_weeks += week</pre><pre>     if not full_weeks:<br>         return {}</pre><pre>     df = DataFrame(full_weeks)</pre><pre>     df[&quot;Symbol&quot;] = symbol<br>         return df.to_dict(&quot;r&quot;)</pre><pre>DataFrame(get_weekly_diffs(get_history(df[&quot;Symbol&quot;][0]))).head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*LJl_kaNw5kEEvCVyv60Oow.png" /><figcaption>First 5 days of stock prices for MMM with weekdays differences comparing to Monday in percentage</figcaption></figure><h3>Step 4: Find mean weekday differences for all stocks</h3><pre>os.sys.path.append(&#39;../github/python_recipes/&#39;)<br>from utils.misc import concurrent_map</pre><pre>histories = []</pre><pre># Next check is needed because some stocks <br># might not contain data at all<br>for df_h in concurrent_map(get_history, df[&quot;Symbol&quot;]):<br>    if not df_h.empty:<br>        histories.append(df_h)</pre><pre>symbol_diffs = flatten(concurrent_map(get_weekly_diffs, histories))</pre><pre>df = DataFrame(symbol_diffs)<br>df = (<br>    df[[&quot;weekday&quot;, &quot;diff&quot;]]<br>    .groupby(&quot;weekday&quot;, group_keys=False)<br>    .mean()<br>    .reset_index(drop=True)<br>)</pre><pre>df = df * 100<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/122/1*iRwgtn7QGiIs9Xe5P4rKyg.png" /><figcaption>Mean weekdays differences comparing to Monday(0 — Monday, 5 — Friday)</figcaption></figure><h3>Step 5: Visualize data</h3><pre>from seaborn import barplot</pre><pre>index2weekday = dict(<br>  zip(<br>    range(0,5),<br>    [&#39;Monday&#39;, &#39;Tuesday&#39;, &#39;Wednesday&#39;, &#39;Thursday&#39;,&#39;Friday&#39;]<br>  )<br>)</pre><pre>df_percent_diff = df - 100<br>df_percent_diff.index = [<br>  index2weekday[w] <br>  for w in df_percent_diff.index<br>]<br>barplot(<br>  x=df_percent_diff.index, <br>  y=list(flatten(df_percent_diff.values))<br>)<br>df_percent_diff</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/162/1*u3MXRWhI01hBBxlVppJILw.png" /><figcaption>Mean weekdays differences comparing to Monday</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*c-rXmQr0hHN0wBXOdrTpSg.png" /><figcaption>Weekdays change in percentage comparing to Monday</figcaption></figure><p>You can see from table and chart that on <strong>Friday stock prices go up to ~0.19%</strong> on “average”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d9130cbf4fb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Python profiling]]></title>
            <link>https://kirillstrelkov.medium.com/easy-python-profiling-a70cbf699295?source=rss-35c531b585fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/a70cbf699295</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[profiling]]></category>
            <dc:creator><![CDATA[Kirill Strelkov]]></dc:creator>
            <pubDate>Fri, 19 Jun 2020 13:15:22 GMT</pubDate>
            <atom:updated>2020-06-19T13:19:33.737Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/13c73db3ec7c70cf5abf207bdeb138ed/href">https://medium.com/media/13c73db3ec7c70cf5abf207bdeb138ed/href</a></iframe><p>More info: <a href="https://jiffyclub.github.io/snakeviz/">https://jiffyclub.github.io/snakeviz/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a70cbf699295" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Analysis of used car price using ADAC]]></title>
            <link>https://kirillstrelkov.medium.com/analysis-of-used-car-price-using-adac-c793ec4890e9?source=rss-35c531b585fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/c793ec4890e9</guid>
            <category><![CDATA[analysis]]></category>
            <category><![CDATA[adac]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Kirill Strelkov]]></dc:creator>
            <pubDate>Sun, 07 Jun 2020 18:59:21 GMT</pubDate>
            <atom:updated>2020-06-14T13:40:02.833Z</atom:updated>
            <content:encoded><![CDATA[<p>ADAC yearly publishes used car prices it can be found <a href="https://www.adac.de/_mmm/pdf/gebrauchtwagenpreise_53800.pdf">here</a></p><p>I have tried to analyze and sum up this data. Here how data looks like in pdf:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kSQnPZJO_HrkYv_mVvw9mA.png" /><figcaption>ADAC used car pdf</figcaption></figure><ol><li>Convert data to jupyter notebook:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*sLEWzUzAxWqZSrgen84i_w.png" /></figure><p>2. Convert years to years since</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*cRjkHI_5P2Z7ku0RG1CIkw.png" /></figure><p>3. Plot all data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*4IAHG6ZlDSj-dhvNYPUAMQ.png" /></figure><p>Fun finding is that some Porsche cars cost more after 1,2,3 years:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*3CrO7i8QFSX_7V8D6Bk5KQ.png" /></figure><p>4. Plot max,median, min values without outliners:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*TaXiPb5W25QQIwugze_g6g.png" /><figcaption>Used car max, median, min price in percentage from initial price</figcaption></figure><p>Numeric values are listed here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*QoN1_4DgHiC_Yna5aa7q4Q.png" /></figure><p>Overview per each car maker/mark:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RMgCkr-xSQNdvNc23Pdbg.png" /></figure><p>Here you can find used car prices between new and 7 years period:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f11739902abbcab41487a8292a540630/href">https://medium.com/media/f11739902abbcab41487a8292a540630/href</a></iframe><p>Here you can find top 10 car manufacturers with least deprecation per year:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/45700bd0a55740307681839f45972d4a/href">https://medium.com/media/45700bd0a55740307681839f45972d4a/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be3393f1d4e82ee4eac6e9c6f0c480cf/href">https://medium.com/media/be3393f1d4e82ee4eac6e9c6f0c480cf/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06bf02743f84fee7cc077863bdac46a4/href">https://medium.com/media/06bf02743f84fee7cc077863bdac46a4/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1f9565024135e801ab1305686618824d/href">https://medium.com/media/1f9565024135e801ab1305686618824d/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7c1b8271e088b474360c775d834b54b1/href">https://medium.com/media/7c1b8271e088b474360c775d834b54b1/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b90cbe45fb9b6a537afc9c59677ea824/href">https://medium.com/media/b90cbe45fb9b6a537afc9c59677ea824/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff72e7053647d474f014ffffc20480f2/href">https://medium.com/media/ff72e7053647d474f014ffffc20480f2/href</a></iframe><p>All data can be found on <a href="https://github.com/kirillstrelkov/playground/tree/master/auto/adac/usedcar">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c793ec4890e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test automation tutorial with Selenium WebDriver part 4: Continuous Integration]]></title>
            <link>https://kirillstrelkov.medium.com/test-automation-tutorial-with-selenium-webdriver-part-4-continuous-integration-548330dabe1e?source=rss-35c531b585fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/548330dabe1e</guid>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[easyselenium]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Kirill Strelkov]]></dc:creator>
            <pubDate>Thu, 05 Apr 2018 19:52:00 GMT</pubDate>
            <atom:updated>2018-05-07T19:29:28.437Z</atom:updated>
            <content:encoded><![CDATA[<h4>Continuous Integration</h4><h4>Setup Git server</h4><ol><li>Install Java if not installed — <a href="https://java.com/en/download/">https://java.com/en/download/</a></li><li>Install Git server</li><li>Download <a href="http://dl.bintray.com/gitblit/releases/gitblit-1.8.0.zip">http://dl.bintray.com/gitblit/releases/gitblit-1.8.0.zip</a> and unpack it</li><li>Open new <em>cmd.exe</em> window</li><li>Go to unpacked folder:<br> example: <em>cd C:\Users\IEUser\Downloads\gitblit-1.8.0</em></li><li>Run command: <em><br> java -jar gitblit.jar — httpPort 80</em></li><li>Now in your browser open ‘<a href="http://localhost/">http://localhost</a>&#39; you should see running Git server:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*NP3_RKmu6OaOoIKy." /></figure><ol><li>Create git remote repository</li><li>Login as admin(username: ‘<em>admin</em>’, password: ‘<em>admin</em>’)</li><li>Click ‘<em>repositories</em>’</li><li>Click ‘<em>new repository</em>’</li><li>Fill in repository data<br>name: <em>osm-testing</em><br>Access Policy: <em>Restrict Push (Authenticated…</em></li><li>Click ‘<em>create</em>’</li><li>Now new repository should be created:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*_LYdzbS6Erjdx43N." /></figure><ol><li>Now you need to copy repository URL — click on ‘URL’ and copy line starting with ‘http’<br>example: <a href="http://admin@localhost/r/osm-testing.git"><em>http://admin@localhost/r/osm-testing.git</em></a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*ulgg7J8ybQJp1vDk." /></figure><ol><li>Push changes to Git server</li><li>Open ‘Git Bash’ and configure:<br><em> git config — global user.email “you@example.com”<br> git config — global user.name “Your Name”</em></li><li>Navigate to folder which contains our testing code(Hint: use ‘cd’ command)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*lGeVgG4Fy2jr5OZ2." /></figure><ol><li>Initialize git local repository:<br><em> git init</em></li><li>Add remote repository:<br><em> git remote add origin </em><br> example: <em>git remote add origin </em><a href="http://admin@localhost/r/osm-testing.git"><em>http://admin@localhost/r/osm-testing.git</em></a></li><li>Push all your changes to remote repository(If needed use ‘admin’ as password):<em><br> git add *<br> git commit -m ‘Initial commit’<br> git push origin master</em></li><li>Go to ‘http://localhost/tree/osm-testing.git&#39; and you should be able to see all our files<em></em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*1BuavCEosW6qSelL." /></figure><h4>Setup Jenkins server</h4><ol><li>Download Jenkins war file:<br><a href="https://jenkins.io/download/">https://jenkins.io/download/</a><br><a href="http://mirrors.jenkins.io/war-stable/latest/jenkins.war">http://mirrors.jenkins.io/war-stable/latest/jenkins.war</a></li><li>Start Jenkins server</li><li>Open command line promt(cmd.exe)</li><li>Navigate to folder where <em>jenkins.war</em> is located</li><li>Start Jenkins server:<br> <em>java -jar jenkins.war</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*rn2MyPetNrMyFQUx." /></figure><ol><li>Remember admin password:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*SpUso7JVx3Enspjm." /></figure><ol><li>Go to Jenkins server — Open ‘<a href="https://medium.com/8080">localhost:8080</a>’ in browser</li><li>Enter password</li><li>Choose ‘<em>Install suggested plugins</em>’</li><li>Set up admin user</li><li>Set proper git.exe path</li><li>click ‘<em>Manage Jenkins</em>’</li><li>click ‘<em>Global Tool Configuration</em>’</li><li>set ‘<em>Path to Git executable</em>’ with path to Git: ‘<em>C:\Program Files\Git\bin\git.exe</em>’ (default location)</li><li>Save</li></ol><h4>Create Jenkins job</h4><ol><li>Click ‘<em>create new job</em>’</li><li>Enter job name ‘<em>osm_test_job</em>’</li><li>choose ‘<em>Freestyle project</em>’</li><li>in ‘<em>Build Triggers</em>’ check ‘<em>Poll SCM</em>’ and in ‘<em>Schedule</em>’ type:<br> <em>H/5 * * * *</em></li><li>in ‘<em>Source Code Management</em>’ choose ‘<em>Git</em>’ and fill <br>‘<em>Repository URL</em>’ with ‘<em>git://localhost/osm-testing.git</em>’</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*HSokrDLyG1GhwU21." /></figure><ol><li>in ‘<em>Build</em>’ click ‘<em>Add build step</em>’ and choose ‘<em>Execute Windows batch command</em>’ and enter:<br><em> easy_selenium_cli.py tests — with-xunit — xunit-file=test_results.xml -b gc</em></li><li>in ‘<em>Post-build Actions</em>’ click ‘<em>Add post-build action</em>’ and choose ‘<em>Publish JUnit test results</em>’ in ‘<em>Test report XMLs</em>’ type ‘<em>test_results.xml</em>’</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*37XK13s6ccUGh473." /></figure><ol><li>click ‘<em>Save</em>’</li><li>click ‘<em>Build</em>’</li><li>After build is finished you should see test results:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*QdZ1gZBes2DiNwxu." /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*SN6mxEybCr-8ZYlE." /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*smBZ1oN6cBk2Di-6." /></figure><h4>Next</h4><p>Try:</p><ol><li>Add new test</li><li>Push to git</li><li>Check that after 5 mins all tests are executed in CI</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=548330dabe1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mobile.de price comparison and discounts]]></title>
            <link>https://kirillstrelkov.medium.com/mobile-de-price-comparison-and-discounts-181a2fbc72cd?source=rss-35c531b585fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/181a2fbc72cd</guid>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[cars]]></category>
            <category><![CDATA[auto]]></category>
            <category><![CDATA[discount]]></category>
            <category><![CDATA[adac]]></category>
            <dc:creator><![CDATA[Kirill Strelkov]]></dc:creator>
            <pubDate>Thu, 15 Mar 2018 21:31:00 GMT</pubDate>
            <atom:updated>2018-05-07T19:49:57.211Z</atom:updated>
            <content:encoded><![CDATA[<p>In short, tried to find biggest discounts for cars which costs &lt; 25000 euro, around Berlin, with adaptive cruise control.<br><br>Here is snapshot of top 20 cars with biggest discount:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a33534a8adb830d79343c50fc0dca4d/href">https://medium.com/media/4a33534a8adb830d79343c50fc0dca4d/href</a></iframe><p><strong>Findings:</strong></p><ul><li>you can get up to ~8000 euro discount for a new car</li><li>non-germans cars are leading in discounts mainly because they don’t offer many options. These options could rise price of the car up to 200%.</li></ul><p>Link to full spreadsheet:<br><a href="https://docs.google.com/spreadsheets/d/1Anp8Tg-1dflcxFHeiHAPBsHLWmwcZF71gwXhVmWVOew/edit?usp=sharing">https://docs.google.com/spreadsheets/d/1Anp8Tg-1dflcxFHeiHAPBsHLWmwcZF71gwXhVmWVOew/edit?usp=sharing</a><br><br>Data is taken from mobile.de with <a href="https://suchen.mobile.de/fahrzeuge/search.html?adLimitation=ONLY_DEALER_ADS&amp;av=INSTANT&amp;cn=DE&amp;damageUnrepaired=NO_DAMAGE_UNREPAIRED&amp;features=ADAPTIVE_CRUISE_CTL&amp;gn=Berlin&amp;isSearchRequest=true&amp;ll=52.516071%2C13.37698&amp;maxPowerAsArray=KW&amp;maxPrice=25000&amp;minPowerAsArray=KW&amp;rd=200&amp;scopeId=C&amp;sr=4&amp;usage=NEW&amp;usageType=PRE_REGISTRATION">this query</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=181a2fbc72cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>