<?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 NDONG HENRY NDANG on Medium]]></title>
        <description><![CDATA[Stories by NDONG HENRY NDANG on Medium]]></description>
        <link>https://medium.com/@ndonghenryndang?source=rss-617b2e40f2b8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*P052uCg16U8k3jUprDwOow.jpeg</url>
            <title>Stories by NDONG HENRY NDANG on Medium</title>
            <link>https://medium.com/@ndonghenryndang?source=rss-617b2e40f2b8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 11:03:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ndonghenryndang/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[Unicorn Companies of the 21th Century (part 2).]]></title>
            <link>https://medium.com/@ndonghenryndang/unicorn-companies-of-the-21th-century-part-2-42a3b438aa4d?source=rss-617b2e40f2b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/42a3b438aa4d</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-aggregation]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-exploration]]></category>
            <dc:creator><![CDATA[NDONG HENRY NDANG]]></dc:creator>
            <pubDate>Mon, 08 Jan 2024 22:23:15 GMT</pubDate>
            <atom:updated>2024-01-08T22:29:17.389Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5BQt7yrygXAJ2-ONPn1FAw.jpeg" /><figcaption>source: <a href="https://mondo.com/wp-content/uploads/2023/08/unicorn-companies-hiring-strategies-rapid-growth-2023-768x403.jpg">mondo</a></figcaption></figure><p>This project is a continuation of a previous project. It is therefore recommended to visit and read the first part to understand the project better and follow through.</p><p>Part one of this project can be found <a href="https://medium.com/@ndonghenryndang/unicorn-companies-of-the-21th-century-3c72c3e9d267"><strong><em>here</em></strong></a></p><p>In this project, we will use precleaned data obtain from the first part.</p><h3>Outline</h3><ol><li>Importing required libraries</li><li>How long does it take companies to become unicorns?</li><li>Which companies had the maximum valuation as per industry?</li><li>Which companies have the highest return on investment?</li><li>Conclusion</li></ol><h3>1. Importing Required libraries and packages</h3><p>To begin, we will import the required libraries and packages for data manipulation and data visualizations. We will be using numpy, pandas, matplotlib and seaborn.</p><pre># import required libraries<br><br>import numpy as np<br>import pandas as pd<br>import matplotlib.pyplot as plt<br>import seaborn as sns</pre><p>Next, load the dataset and display the last five rows.</p><pre># import the clean dataset <br><br>unicorns = pd.read_csv(&#39;../Data/Clean data/unicorns.csv&#39;)<br><br># display the last five rows with all attributes<br><br>unicorns.tail()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AsMFHXOczmbpsA-Nv2Q5Aw.png" /></figure><h3>2 . Time it took companies to reach unicorn status.</h3><p>The time a company takes to reach unicorn status is the time between when the company was founded and when the company’s valuation reached 1 billion dollars.</p><p>To calculate this time based on the data we have, we will take the difference between the Year a company become unicorn (date joined) and the year it was founded.</p><pre># substract the year founded from the year joined column in our dataset to know when each company become unicorn<br># assign the results to another variable called Year_till_unicorn<br><br>unicorns[&#39;Years_till_unicorn&#39;] = unicorns[&#39;Year Joined&#39;] - unicorns[&#39;Year Founded&#39;] <br><br># # display the first 5 rows with the columns company, industry, year founded, year joined, and years till unicorn<br><br>unicorns[[&#39;Company&#39;,&#39;Industry&#39;,&#39;Year Founded&#39;,&#39;Year Joined&#39;,&#39;Years_till_unicorn&#39;]].head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*SdYZHrC2ERDTM42LpGSsyg.png" /></figure><p>As displayed in the output cell above, Bytedance took 5 years to become unicorn, SpaceX and SHEIN took 10 years while Strip and Klarna took 4 and 6 years respectively.</p><p>Now, let’s visualize the maximum number of years companies took to become unicorn per industry.</p><pre># to prepare the data, we will create a new dataframe named industry_max<br># select the industry and years till unicorn to include in this dataframe.<br># use the .max() to obtain only the maximum values per industry.<br># use the .sort_values() to sort the dataframe from descending or ascending order using the years till unicorn values.<br><br><br>industry_max = (unicorns[[&#39;Industry&#39;, &#39;Years_till_unicorn&#39;]].groupby(&#39;Industry&#39;).max().sort_values(by = &#39;Years_till_unicorn&#39;, ascending=False))<br><br># display the dataframe industry_max<br><br>industry_max</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*FNQ_RmkmUc40k2Yig6GDMg.png" /></figure><p>The output cell above tell us that the maximum number of years a company in the health industry took to become unicorn is 98 years. In the consumer and retail industry, the maximum number of years a company took to reach unicorn status was 37 years and so on.</p><p>Let us visualize the results above to a simple and compelling visualization for easy comprehension and understanding</p><pre># visualize this information on a graph using industry column as the bar categories and years till unicorn as the height of bars.<br><br>plt.bar(industry_max.index, industry_max[&#39;Years_till_unicorn&#39;])<br><br># set the title<br><br>plt.title(&#39;Maximum Years for Company to reach Unicorn per Industry &#39;)<br><br># set x axis<br><br>plt.xlabel(&#39;Industry&#39;)<br><br># set y axis label<br><br>plt.ylabel(&#39;Maximum years&#39;)<br><br># rotate labels on the x axis to avoid overlap<br><br>plt.xticks(rotation = 45, horizontalalignment = &#39;right&#39;)<br><br># display the plot<br><br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*Qdi16FdJ_Dk-DagYJmlkXw.png" /></figure><h3>Question</h3><p>Can any trend be identified from when a company was founded and how long it took to become a unicorn?</p><p>To observe and answer the above question, let’s visualize when the year when companies were founded and how long the took to reach unicorn status.</p><p>We will use the seaborn package to visualize the information on a bar chart.</p><pre># first set the figure size<br><br>plt.figure(figsize=(16,10))<br><br># define the x and y values. in this cause, year founded will be on the x axis<br><br>sns.barplot(x=unicorns[&#39;Year Founded&#39;],y=unicorns[&#39;Years_till_unicorn&#39;], ci=None)<br><br># set the title and font size<br>plt.title(&#39;Years for Companies to reach Unicorn Status with respect to Year Founded&#39;, fontsize=17)<br><br># set the xlabel and ylabels<br><br>plt.xlabel(&#39;Year Founded&#39;, fontsize=16)<br>plt.ylabel(&#39;Years to reach unicorn status&#39;, fontsize=14)<br><br># rotate the xlabels for easy readabilty and no overlaps<br><br>plt.xticks(rotation=45, horizontalalignment=&#39;right&#39;)<br><br># show the graph<br><br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MHofjvPol0uQPg_jdhTAQg.png" /></figure><p>It is clear from the data that companies founded earlier took longer to reach unicorn status while companies founded later in the dataset easily became unicorns.</p><h3>3. Which companies had the maximum valuation as per industry?</h3><p>To achieve this task, we prepare the data by creating another dataframe which will hold data on industry and valuation. we will use the .max() to obtain the companies with maximum valuation per industry.</p><pre># This line of code creates a dataframe called max_valuation with 2 columns, industry and valuation.<br># the groupby() is used to aggragate and obtain the maximum values using max()<br># sort_values() is used to sort the dataframe from smallest to largest using the valuation<br><br>max_valuation = (unicorns[[&#39;Industry&#39;, &#39;Valuation(billions)&#39;]].groupby(&#39;Industry&#39;).max().sort_values(by=&#39;Valuation(billions)&#39;))<br><br># display the dataframe<br><br>max_valuation</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/407/1*6SYIVIXDb-7dNh4-JdYrgQ.png" /></figure><p>The maximum valuation of a company in the Cybersecurity industry is $9B while the artificial intelligence industry has the max with $180B.</p><p>Let’s see how this information appear on a bar chart.</p><pre># draw a bar chart to visualize results<br><br># visualize this information on a graph using industry column as the bar categories and years till unicorn as the height of bars.<br><br>plt.bar(max_valuation.index, max_valuation[&#39;Valuation(billions)&#39;])<br><br># set the title<br><br>plt.title(&#39;Maximum valuation of companies per industries&#39;)<br><br># set x axis<br><br>plt.xlabel(&#39;Industry&#39;)<br><br># set y axis label<br><br>plt.ylabel(&#39;Max valuation in billion dollars&#39;)<br><br># rotate labels on the x axis to avoid overlap<br><br>plt.xticks(rotation = 45, horizontalalignment = &#39;right&#39;)<br><br># display the plot<br><br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*7S54qjRdmHgfEdPVrhyNMQ.png" /></figure><p>Let’s look at the top 10 most valued companies in our dataset with their associated industries.</p><pre># display 10 unicorn companies with the biggest return on investments<br># first create a dataframe with name top10 with three columns company, valuation and industry<br><br>top10 = unicorns[[&#39;Company&#39;, &#39;Valuation(billions)&#39;, &#39;Industry&#39;]].head(10)<br><br>#display the dataframe.<br><br>top10</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*-B8y0K9Y-WlDkgDmCy2GIw.png" /></figure><h3>4. Which companies have the highest return on investment?</h3><p>Return on investment, or ROI, is a financial ratio that measures the profitability of an investment relative to its costs, expressed as a percentage. It is calculated by dividing the net return (gain or loss) from an investment by the initial cost of the investment. ROI is useful for comparing the efficiency and attractiveness of different investments</p><p>Now we will look at ROI as per industry and company to find which companies are more profited. This will help us make business recommendations to investors as well as verify if companies with high valuation also have high ROI values.</p><p>To calculate the ROI for each company, we will use the valuation of the company and the funding received.</p><p><strong>that is, ROI = (Valuation — funding)/funding * 100%</strong></p><pre># use the formula for roi and the valuation and funding(billion) columns<br># assign the results to another variable named roi<br># use the round() to round the roi to 2dp<br>unicorn_roi[&#39;roi&#39;] = round(((unicorn_roi[&#39;Valuation(billions)&#39;] - unicorn_roi[&#39;Funding(billions)&#39;]) / unicorn_roi[&#39;Funding(billions)&#39;])*100,2)<br><br># display five rows<br><br>unicorn_roi.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*deC7v1BlSh9nwYiYAqvHnw.png" /></figure><p>Let’s also look at top 10 companies with highest ROI .</p><pre># display the top 10 companies with maximum ROI values<br><br>top10_roi=unicorn_roi[[&#39;Company&#39;, &#39;roi&#39;]].sort_values(by=&#39;roi&#39;, ascending=False).head(11)<br><br>top10_roi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*LfC0B7E7lN5-HSSHrUnMMg.png" /></figure><p>Now, let’s look at the companies with biggest ROI values per industry.</p><pre># This line of code creates a dataframe called max_valuation with 2 columns, industry and valuation.<br># the groupby() is used to aggragate and obtain the maximum values using max()<br># sort_values() is used to sort the dataframe from smallest to largest using the valuation<br><br>max_roi = (unicorn_roi[[&#39;Industry&#39;, &#39;roi&#39;]].groupby(&#39;Industry&#39;).max().sort_values(by=&#39;roi&#39;))<br><br>max_roi</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*xJdG8hcs50MAp3lK9O6yKw.png" /></figure><p>Visualizing the above in a chart,</p><pre># draw a bar chart to visualize results<br><br># visualize this information on a graph using industry column as the bar categories and roi as the height of bars.<br><br>plt.bar(max_roi.index, max_roi[&#39;roi&#39;])<br><br># set the title<br><br>plt.title(&#39;Maximum roi of companies per industries&#39;)<br><br># set x axis<br><br>plt.xlabel(&#39;Industry&#39;)<br><br># set y axis label<br><br>plt.ylabel(&#39;Max roi (percentage)&#39;)<br><br># rotate labels on the x axis to avoid overlap<br><br>plt.xticks(rotation = 45, horizontalalignment = &#39;right&#39;)<br><br># display the plot<br><br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*0StkSYJdg-XxTDZFa63gMA.png" /></figure><p>The company with the highest ROI value is in the internet software and services industry followed by Fintech.</p><h3>5. Conclusion</h3><ol><li>As time goes on, companies take relatively shorter periods of time to reach unicorn status.</li><li>The most valued company is in the artificial intelligence industry.</li><li>The company with the biggest return on investment is in the internet software and service industry.</li></ol><p><strong>Thanks for reading!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42a3b438aa4d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Internet Prices: Trends and Patterns across countries.]]></title>
            <link>https://medium.com/@ndonghenryndang/internet-prices-trends-and-patterns-across-countries-23357bf955e2?source=rss-617b2e40f2b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/23357bf955e2</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[internet-price]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[data-exploration]]></category>
            <dc:creator><![CDATA[NDONG HENRY NDANG]]></dc:creator>
            <pubDate>Wed, 20 Dec 2023 08:47:49 GMT</pubDate>
            <atom:updated>2023-12-20T08:47:49.865Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*CbGoABmhHlmxXhH7Ok4NVQ.png" /></figure><p>As technology continues to advance, the need for internet access continue to increase as million of people as well as businesses and organizations become internet users each year. Due to this trend, the number of people accessing the internet are bound to continually increase as time goes on.</p><p>There is indeed a great need for internet access and users are more concern with the price and quality of the internet packages available to them at each point in time. Two (2) typical questions asked by users when purchasing internet services are:</p><ol><li>What is the quality and speed of this internet package?</li><li>what is the price of the internet package?</li></ol><p>In addition, the third question that arise might be</p><p>3. How many internet packages are being offered.</p><p>In this project, we analyze a sample dataset containing information about internet prices across different countries and continental regions to evaluate the prices of internet services and how they compare to different countries. The data used has been precleaned.</p><h3>Outline</h3><ol><li>Objectives</li><li>Tools used</li><li>Variable Description</li><li>Data exploration</li><li>Formal Analyses</li><li>Key Findings</li><li>Conclusions</li></ol><h3>1. Objectives</h3><p>The objective of this project is to analyze data to derive insights, detect patterns and trends in internet prices in different countries and continental regions.</p><h3>2. Tools Used</h3><p>The tools used to perform this exercise is SQL precisely MySQL Shell version 8.0.31 to query the data and excel 2010 to visualize query results.</p><h3>3. Variable Description</h3><ul><li><strong>country_code:</strong> A unique code assigned to each country</li><li><strong>Country:</strong> The name of the country under consideration</li><li><strong>continental_region:</strong> The specific continental region to which the country belong</li><li><strong>number_of_plans:</strong> The counts of different internet plans available in the country.</li><li><strong>average_price:</strong> The mean cost of 1 gigabyte of internet data in dollars</li><li><strong>cheapest:</strong> The price of the least expensive 1 gigabyte internet plan for a duration of 30 days, in USD.</li><li><strong>most_expensive:</strong> The cost of the most high-priced 1 gigabyte internet plan in dollars</li><li><strong>average_price_2021:</strong> The average cost of 1 gigabyte of internet data at the beginning of 2020, in USD</li><li><strong>average_price_2020:</strong> The average cost of 1 gigabyte of internet data at the start of 2021, in USD.</li><li><strong>internet_users:</strong> The number of people using internet services in the country of consideration.</li><li><strong>Population:</strong> The total population of the country</li><li><strong>data_rate:</strong> The average speed of internet plans in that country in Mbit/s.</li></ul><p><a href="https://www.kaggle.com/code/vigneshp1997/netspend-2022-analyzing-internet-costs-worldwide"><strong><em>Reference</em></strong></a></p><h3>4. Data Exploration</h3><p>First, lets look at the different columns (or fields or variables) present in our database table named internetprices.</p><pre>SHOW COLUMNS FROM internetprices;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*eDeCCL8ijOEhZn7vgqnfgg.png" /></figure><p>Now, let’s preview the data stored on the dataset by looking at the first 10 rows (countries) and their internet characteristics. I have left out some columns and displayed majority.</p><pre>SELECT country, number_of_plans, average_price, cheapest, most_expensive, average_price_2020, average_price_2021, data_rate<br>FROM internetprices;</pre><blockquote>The SELECT statement is one of the most important SQL commands. It is used to specify from which fields data should be fetched based on the table under consideration. The FROM keyword is used to specify the table to be queried.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zLiwT-xkAZqcCsPWVQNTBw.png" /></figure><p>Let’s find out how many countries are included in this table</p><pre>SELECT COUNT(DISTINCT country)AS Number_of_countries<br>FROM internetprices</pre><blockquote>Here, aside the SELECT and FROM keywords, we have used COUNT, DISTINCT, and AS. The COUNT keyword is used to compute the number of rows that satisfy the given condition. In this case, COUNT is used to return the number of countries represented in the dataset. DISTINCT is to ensure that results are not duplicated by ensuring that only unique rows across the table are returned. The last keyword here is AS. This is used for aliasing. That is, it helps us to rename the field that we are querying in the query output.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/191/1*MCgbhfcWw9t1aKnrDg-T7g.png" /></figure><p>As observed in the query result above, there are 133 unique countries in this dataset and the column (field) name in the results has been changed from countryto Number_of_countries</p><p>Let’s also look at the continental regions included in the dataset. Of course several countries will belong to the same region hence we will display only the unique regions represented.</p><pre>SELECT DISTINCT continental_region<br>FROM internetprices</pre><blockquote>Using DISTINCT here avoids the query from selecting the continental region of all 133 countries since many countries obviously belong to the same continental regions hence only the unique values are fetched from the table.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*Ru95U63pclLC-Y6p0Nct0w.png" /></figure><p>All 133 countries represented in this dataset belong to 13 continental regions.</p><h3>5. Formal Analysis</h3><p>Display the top 10 countries with highest average price per GB (USD)</p><pre>SELECT country, average_price AS `Average price of 1GB (USD)`<br>FROM internetprices<br>ORDER BY average_price DESC<br>LIMIT 10;</pre><blockquote>Here, in addition to the SELECT, FROM, AS, we have introduced ORDER BY, DESC, and LIMIT. ORDER BY is used in SQL for sorting the output of a query either by a numeric column (smallest to largest or vice versa) or a string typed column (A — Z or Z — A). DESC specifies that the data be sorted in descending order. LIMIT specifies the number of rows we wish to display.</blockquote><p>In the above query, we are selecting the country and average price which is renamed as Average price of 1GB (USD) from the table internetprices and we want the results sorted in descending order by using the average price column displaying just the top rows which represent the top 10 countries with highest average price per GB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*aLD6BntWyh7ixMHbgOBivw.png" /></figure><p>The data reveal that Malawi has the average price per GB followed by Yemen and Cyprus.</p><p>The graph below visualize the results into a bar graph making the pattern easy to identify.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TTmMtf4793N_OFLmqRfqAQ.png" /></figure><p>It will also be great to look at the countries with the lowest average price per GB. For this, we just modify the code above to sort the values in ascending order and again return the first 10 rows.</p><pre>SELECT country, average_price AS `Average price of 1GB (USD)<br>FROM internetprices<br>ORDER BY average_price ASC<br>LIMIT 10;</pre><p>ASC sorts the results from smallest to largest in case of numeric column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*r6dHLa6bBNjj_wNhtg3Jxg.png" /></figure><p>Findings show that Israel, Kyrgyzstan and Fiji are three countries with lowest cost per GB.</p><p>The dataset contains information about average internet prices in 2020 and 2021. Let’s use this to find out patterns across countries in terms of average price per GB between 2020 and 2021</p><p>First let’s look at the top 10 countries with highest average prices in 2020</p><pre>SELECT country, average_price_2020 AS `Average price of 1GB (USD) in 2020`<br>FROM internetprices<br>ORDER BY average_price DESC<br>LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*CvA2U8vfu_hE3u51dHvJaQ.png" /></figure><p>At the start of 2020, Nicaragua had the highest average price per GB followed by Czech Republic and Cyprus.</p><p>Looking at 2021,</p><pre>SELECT country, average_price_2021 AS `Average price of 1GB (USD) in 2021`<br>FROM internetprices<br>ORDER BY average_price_2021 DESC <br>LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/489/1*bDa1oP75yeqEmXIYVApTew.png" /></figure><p>Malawi had the highest average price per GB in 2021 followed by Yemen and Botswana.</p><p>Visualizing this on graphs, we have;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*65N9f9E4WZUpuDpHO8BqgA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NIj9ZyFkWOUdawX-yyzmFA.png" /></figure><p>It is also insightful to find out between 2020 and 2021, did the average internet price increase or decrease and by what percentage.</p><pre>SELECT ROUND(AVG(average_price_2020),2) AS `Average price in 2020`, <br>ROUND(AVG(average_price_2021),2) AS `Average price in 2021`,<br>ROUND((AVG(average_price_2020)-avg(average_price_2021)),2) AS `Drop in average price(2020-2021)`,<br>ROUND((AVG(average_price_2020)-AVG(average_price_2021))/AVG(average_price_2020)*100,2) AS `Percentage drop` <br>FROM internetprices;</pre><blockquote>In this statement, ROUND and AVG have been introduced. ROUND is used to round up a numeric value by a certain number of decimal places. AVG is an aggregate function that returns the average of the numerical field associated with it.</blockquote><p>This query calculates the average of average internet prices in 2020 and 2021 rounding it up to 2 decimal points. These 2 columns are then used to calculate the drop in the average internet price by substracting average prices in 2021 from 2020. The percentage drop is obtained by dividing this value drop by the average price in 2020 and multiplying by 100.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*2icWL7UH-qEEa7HqEVTPAw.png" /></figure><p>Between the start of 2020 and the start of 2021, internet prices dropped by 45.02%.</p><p>To verify if countries with highest average cost of 1GB have the lowest number of internet plans, lets display the top 10 countries with the lowest number of internet plan</p><pre>SELECT country, number_of_plans, average_price AS `Average cost of 1GB`<br>FROM internetprices<br>ORDER BY number_of_plans ASC<br>LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*GvJBdt_KjV7jx1QygxRv9A.png" /></figure><p>Which countries have the most expensive internet prices for 1GB?</p><pre>SELECT country, most_expensive AS `Most expensive price of 1GB`<br>FROM internetprices<br>ORDER BY most_expensive DESC<br>LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*S1YRmT-XqvYHddFoDLilXw.png" /></figure><p>Greece has the most expensive internet price per GB followed by Trinidad and Tobago and France.</p><p>Which countries have the cheapest prices for 1GB per month (30days)</p><pre>SELECT country, cheapest AS `cheapest price of 1GB<br>FROM internetprices<br>ORDER BY cheapest ASC<br>LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*acZbGEaKYNYBof1CydLSKw.png" /></figure><p>The cheapest internet prices are available in Fiji, Sudan, China, Finland and others.</p><p>Lets now consider the speed of data being offer. Which countries have the best quality of internet in terms of speed.</p><pre>SELECT country, data_rate AS `Average data speed (Mbit/s)<br>FROM interprices<br>ORDER BY data_rate DESC<br>LIMIT 10;<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*6qlYGebZkfn2Kezi_WXCrQ.png" /></figure><p>Which countries have the lowest internet quality in terms of speed?</p><pre>SELECT country, data_rate AS `Lowest average data speed (Mbit/s)<br>FROM interprices<br>ORDER BY data_rate ASC<br>LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*jDTWZNNeATrovdFOygljiw.png" /></figure><p>Among countries with lowest data rate, we have Afghanistan, Tajikistan, Somalia, Ghana.</p><p>Next, lets look at the average price of 1GB of countries belonging to the same continental region.</p><pre>SELECT continental_region, ROUND(AVG(average_price), 2) AS `Average price of 1GB per Region<br>FROM internetprices<br>GROUP BY continental_region<br>ORDER BY AVG(average_price) DESC</pre><blockquote>GROUP BY is used to group rows based on a specified column and apply an aggregate function to it.</blockquote><p>In this query, the aggregate AVG is used to calculate the average internet prices for all countries in the same continental regions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*Qb57UZ4DW-14E_xtfUpHhA.png" /></figure><p>Countries in Northern America and Near East have the highest average prices for 1GB. Countries in Northern Africa have the lowest average cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axNVEjfl1My9E-aijvRO2Q.png" /></figure><p>Which countries have the highest percentage of internet users as well which countries have the lowest percentage of internet users?</p><p>First, lets find out countries with highest percentage of internet users</p><pre>SELECT country, continental_region, population, internet_users, ROUND((internet_users/population)*100, 2) AS `Percentage of internet users`<br>FROM internetprices<br>ORDER BY ((internet_users/population)*100) DESC<br>LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*bLlzf61IEoJ9uW654BncfA.png" /></figure><p>Kuwait, united Kingdom, Aruba are countries with the highest number of internet users.</p><p>Next, following are countries with least number of internet users</p><pre>SELECT country, continental_region, population, internet_users, ROUND((internet_users/population)*100, 2) AS `Percentage of internet users`<br>FROM internetprices<br>ORDER BY ((internet_users/population)*100) ASC<br>LIMIT 10;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*4qLHEXmWBlsNwAIQHDNckw.png" /></figure><p>Of 10 countries with lowest number of internet users, 7 are countries in Sub-Saharan Africa (Somalia, Togo, Angola, Malawi, Kenya, Ethiopia and Mozambique).</p><h3>6. Key Findings</h3><ul><li>133 countries were included in this dataset.</li><li>Malawi had the highest average price per GB meanwhile analysis revealed that Israel had the lowest internet price per GB.</li><li>Average internet prices dropped by 45.02% between the start of 2020 and 2021.</li><li>Greece offered the most expensive internetprices per GB.</li><li>United Arab Emirates had the best internet quality in terms of speed followed by Norway.</li><li>As per continental region, Northern America had the highest average price per GB</li><li>The proportion of internet users was highest in Kuwait with 97.98% of the entire population using the internet followed by United Kingdom with a proportion of 96.81%.</li><li>7 out of 10 countries with the least proportion of internet users are countries in Sub-Saharan Africa.</li></ul><h3>7. Conclusion</h3><p>In this project, we used SQL and Microsoft Excel to analyze and report findings derived from a dataset containing data on internet prices across different countries.</p><h3>Thanks for reading!</h3><p>If you found this project educative, then do give me a clap and leave your thoughts in the comment section.</p><p>Do follow me to instantly get a notification when I post other projects.</p><p>Are you a data nerd or a tech star, lets connect on <a href="https://www.linkedin.com/in/ndong-henry-ndang-3946ab243/"><strong><em>LinkedIn</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23357bf955e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unicorn Companies of the 21th Century .]]></title>
            <link>https://medium.com/@ndonghenryndang/unicorn-companies-of-the-21th-century-3c72c3e9d267?source=rss-617b2e40f2b8------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c72c3e9d267</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[descriptive-statistics]]></category>
            <category><![CDATA[exploratory-data-analysis]]></category>
            <dc:creator><![CDATA[NDONG HENRY NDANG]]></dc:creator>
            <pubDate>Mon, 11 Dec 2023 21:49:30 GMT</pubDate>
            <atom:updated>2024-01-08T22:27:26.461Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unicorn Companies of the 21th Century .</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5BQt7yrygXAJ2-ONPn1FAw.jpeg" /><figcaption>source: <a href="https://mondo.com/wp-content/uploads/2023/08/unicorn-companies-hiring-strategies-rapid-growth-2023-768x403.jpg">mondo</a></figcaption></figure><h4><strong>Project Overview</strong></h4><p>In this project, you are part of an analytical team that provides valuable insights to an investment firm. The firm is seeking guidance on potential investment opportunities in unicorn companies (companies valued at over $1B). The dataset at your disposal contains information on over 1000 such companies, including details about their industry, country of origin, year of establishment, and key investors. Your task is to analyze this data to understand the patterns and factors that have contributed to these companies achieving their unicorn status. Based on your findings, you will provide recommendations to the investment firm on potential investment strategies. This will assist the firm in making informed decisions about future investments.</p><h4><strong>General Objective:</strong></h4><p>Extracting insights from the data provided and helping the firm makes informed business decisions pertaining to investment.</p><h4><strong>Specific Objectives</strong></h4><ol><li>Perform Exploratory Data Analysis, summarizing the key features in the data as well as clean and format data for further analysis.</li><li>Evaluate company performance based on their Valuation, time to reach Unicorn status per country, industry and continent.</li><li>Perform hypothesis testing to make inferences and recommendation to stakeholders</li></ol><h4><strong>Project Structure</strong></h4><p>This project will be divided into different parts (labs) with each lab aimed at achieving a single specific objective.</p><p>We will use the unicorn companies dataset to perform our analysis. You can assess the dataset from Kaggle <a href="https://www.kaggle.com/datasets/mysarahmadbhat/unicorn-companies"><strong>here</strong></a><strong> .</strong></p><p>In this lab, our objective is to perform Exploratory Data Analysis (EDA) and data structuring that will help prepare data for modelling with the aim of gaining insights and providing business recommendation to the investment firm.</p><blockquote>EDA is simply the act of exploring and performing preliminary analysis on a dataset with the aim to familiarize, understand and discover the characteristics of the data. This is essential as it helps analyst to ask better questions and extract meaning statistics</blockquote><h4><strong>Outline</strong></h4><ol><li><strong>Importing required libraries and packages and the dataset</strong></li><li><strong>Variable description</strong></li><li><strong>Data exploration</strong></li><li><strong>Data cleaning and structuring</strong></li><li><strong>Data visualization</strong></li><li><strong>Key findings</strong></li><li><strong>Conclusion</strong></li></ol><h4><strong>1. Importing required libraries, packages and the dataset</strong></h4><p>To begin, import required libraries and packages.</p><pre>import numpy as np <br>import pandas as pd <br>import matplotlib.pyplot as plt<br>import datetime as dt</pre><p>Next, load the dataset.</p><pre>unicorns = pd.read_csv(r&quot;..\Data\Raw Data\Unicorn_Companies.csv&quot;)</pre><h4><strong>2. Variable description</strong></h4><p>We need to know the variables in the dataset before analyzing them. This help us to have a clear understanding of dataset content.</p><ul><li><strong>company:</strong> Name of unicorn company</li><li><strong>Valuation:</strong> The company’s value as of march 2022</li><li><strong>Data Joined:</strong> The date the company become a unicorn (reached $1B in valuation)</li><li><strong>Industry:</strong> The industrial sector to which the company belongs</li><li><strong>City: </strong>City in which the company is located</li><li><strong>Country:</strong> Country where the unicorn company is located</li><li><strong>Continent:</strong> Continent to which the company is located</li><li><strong>Year Founded:</strong> Year in which the company founded</li><li><strong>Funding:</strong> The amount of money invested into the company</li><li><strong>Select Investors:</strong> Represent the top investors in the company</li></ul><h4><strong>3. Data exploration</strong></h4><p>Preview the dataset to have an overview of the data.</p><pre>unicorns.head()</pre><blockquote><strong>.head()</strong> returns the first five rows of the dataset. we can also use <strong>.tail()</strong> to view the last five rows in the data</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3dXUMNMPRGyFwe0peviGWg.png" /></figure><p>Display the total number of rows and columns in the dataset.</p><pre>unicorns.shape</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/113/1*3L6nQQuaobH3R9oGkoyfhQ.png" /></figure><p>We have 1074 rows (observations) and 10 columns</p><blockquote><strong>unicorns.shape</strong> returns a tuple (pair of values ) that represents the dimensions of the dataset.</blockquote><pre>unicorns.info()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*C8BCfRlxnyoh_I31xeUThA.png" /></figure><blockquote><strong>unicorns.info()</strong> gives information about the dataset set like various columns and their data types, number of not null values and the memory usage.</blockquote><p>Knowing the data type of a variable is important because it indicates the type of analysis that can be done with that variable and also how it can be aggregated with other variables.</p><pre>industries = unicorns[[&#39;Industry&#39;]].groupby(&#39;Industry&#39;).sum()<br>industries</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*B0uDO7PqGz5qzCYUgSBHxw.png" /></figure><p>As displayed above, we have 2 different spellings for the industry “artificial intelligence”.</p><p>To clean this up, we replace one of the spellings with the other to have just a single name artificial intelligence</p><pre>unicorns[&#39;Industry&#39;] = unicorns[&#39;Industry&#39;].replace(&#39;Artificial Intelligence&#39;, &#39;Artificial intelligence&#39;)</pre><blockquote><strong>.replace()</strong> takes 2 strings, the first is the string that needs to be remove while the second string is the new string that needs to replace the old string.</blockquote><pre>unicorns.describe()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/186/1*kPZx2j8mZ0HCLCWiBCkKCw.png" /></figure><p>Since the minimum and maximum value in the year founded column is 1919 and 2021, it tells us that the dataset does not contain data about unicorn companies that were founded before 1919 and 2021.</p><blockquote><strong>unicorns.describe()</strong> produce descriptive statistics. By default it considers only the numeric columns in our dataset. The results will include the five summary statistics ( min, max, lower quantile, median, upper quantile ) in addition to the count, mean, and std .</blockquote><pre>unicorns[[&#39;Industry&#39;,&#39;Country&#39;, &#39;City&#39;,&#39;Continent&#39;]].describe()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*aLwuioRaNtFD7jcjPvwkMw.png" /></figure><p>There are 15 unique industries represented in the dataset with the Fintech as the highest occurring industry with 224 observations</p><p>The dataset contains data from 46 countries with USA having the highest frequency of 562</p><p>256 cities are represented in the dataset and San Francisco has the most unicorns (152 observations)</p><p>Unicorn data is from 6 continents and North America has the highest frequency (589 observations)</p><blockquote>Using the <strong>unicorns.describe()</strong> on non numeric columns (object datatypes), the results obtain will include count, unique, top, and freq . The top is the most common value and the freq is the number of times this value appears in the dataset.</blockquote><h4><strong>4. Data cleaning and Structuring</strong></h4><p>As observed earlier, Date Joined is of type object. hence, we have to convert it to datetime. This splits each value in the column into year, month and day components. This is important in data cleaning, as it makes the data in this column easier to use in task we may encounter. For example, to know when and how long companies take to reach unicorn status, we need to compare the Date Joined and the Date Founded. Having Date Joined in datetime form will help accomplish such task since we can easily extract the years and do comparisons.</p><pre>unicorns[&#39;Date Joined&#39;] = pd.to_datetime(unicorns[&#39;Date Joined&#39;])</pre><blockquote><strong>.to_datetime()</strong> splits the Date Joined column into year, month and day. we can from here easily extract the year, month or even day into different columns for further analysis and exploration.</blockquote><pre>unicorns[&#39;Date Joined&#39;].info()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*aSaDkUGbRBMkPGsM0F-9YQ.png" /></figure><p>Now, we have successfully converted the Date Joined column into datetime</p><pre># use the .dt.year to extract the year from &quot;Date Joined&quot;<br># add the new column to the dataset.<br><br>unicorns[&#39;Year Joined&#39;] = unicorns[&#39;Date Joined&#39;].dt.year</pre><blockquote><strong>.dt.year</strong> is used to extract only the year in the Date Joined column and creating another column in the dataset called Year Joined.</blockquote><p>Next, the valuation column is also an object. However, this column will be more important if it is of type integer and represented as digits. This will help us perform calculations on it, aggregating with other functions.</p><pre># next, to ease calculations on the valuation, create another column <br># named &#39;valuation(billions)&#39; using the existing valuation column.<br><br>unicorns[&#39;Valuation(billions)&#39;] = unicorns[&#39;Valuation&#39;]<br><br># on the new column created, remove the B and $. this is to obtain the <br># valuation as numbers (int) for further analysis<br><br>unicorns[&#39;Valuation(billions)&#39;] = unicorns[&#39;Valuation(billions)&#39;].str.replace(&#39;B&#39;, &#39;&#39;)<br>unicorns[&#39;Valuation(billions)&#39;] = unicorns[&#39;Valuation(billions)&#39;].str.replace(&#39;$&#39;, &#39;&#39;)<br><br># change the datatype to &#39;int&#39;<br><br>unicorns[&#39;Valuation(billions)&#39;] = unicorns[&#39;Valuation(billions)&#39;].astype(&#39;int&#39;)<br><br># display to verify <br><br>unicorns.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eobo_9OhrrMrX2rAbJgPew.png" /></figure><p>Now, we have added 2 columns to the dataset set (Year Joined and Valuation(billions).</p><h4>5. Data Visualization</h4><p>We will perform univariate analysis on our variables. This is to understand the distribution the distribution of values for each variable.</p><pre># sort the various industries from highest count to lowest<br><br>industry_count= unicorns[&#39;Industry&#39;].value_counts().sort_values(ascending=False)<br><br># visualize the industries to see which industries have the most unicorns<br><br>sn.countplot(y=&#39;Industry&#39;, data=unicorns, order=industry_count.index)<br>plt.title(&#39;Counts per Industry&#39;)<br>plt.xlabel(&#39;Count&#39;)<br>plt.ylabel(&#39;Industry&#39;, size = 14)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*WvCS14aAXGj6qHLTJNpNTQ.png" /></figure><p>The most companies represented in the dataset are from the fintech industry followed by the internet software &amp; services industry meanwhile Travel has the least unicorns in the dataset.</p><p>There are about 46 countries in the dataset. Visualizing the number of unicorns per country will make the graph messy since there are so many data points.</p><p>So, we can visualize the number of unicorns per country but display only the first 10 countries with the most unicorns.</p><pre># sort the various Countries from highest count to lowest<br><br>C_count= unicorns[&#39;Country&#39;].value_counts().sort_values(ascending=False)<br><br># visualize the Results to see which countries have the most unicorns<br><br>sn.countplot(y=&#39;Country&#39;,data=unicorns, order=C_count.index[:10])<br>plt.title(&#39;First 10 Countries with most Unicorns&#39;)<br>plt.xlabel(&#39;Count&#39;)<br>plt.ylabel(&#39;Top 10 Countries&#39;, size = 14)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*Plp3qMOSOu235TFMSNaLYg.png" /></figure><p>USA has the most unicorns followed by China and India. Meanwhile Brazil and Singapore stand at the 9th and 10th position respectively.</p><pre># sort the various Countries from highest count to lowest<br><br>C_count= unicorns[&#39;City&#39;].value_counts().sort_values(ascending=False)<br><br># visualize the Results to see which countries have the most unicorns<br><br>sn.countplot(y=&#39;City&#39;,data=unicorns, order=C_count.index[:10])<br>plt.title(&#39;First 10 Cities with most Unicorns&#39;)<br>plt.xlabel(&#39;Count&#39;)<br>plt.ylabel(&#39;Top 10 Cities&#39;, size = 14)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*dblolpU7oxmNZ-3ZwSohgw.png" /></figure><p>San Francisco and New York have the highest unicorns. At the 9th and 10th positions we have Palo Alto (USA) and Berlin respectively.</p><pre># sort the various continents from highest count to lowest<br><br>C_count= unicorns[&#39;Continent&#39;].value_counts().sort_values(ascending=False)<br><br># visualize the industries to see which continents have the most unicorns<br><br>sn.countplot(y=&#39;Continent&#39;,data=unicorns, order=C_count.index)<br>plt.title(&#39;Number of Unicorns per Continents&#39;)<br>plt.xlabel(&#39;Count&#39;)<br>plt.ylabel(&#39;Continent&#39;, size = 14)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*ljCvCyfV6u1wsfUr-moQIg.png" /></figure><p>North America and Africa have the highest and least Unicorns respectively.</p><p>The purpose of EDA, data cleaning and structuring is to prepare data for further analysis or modelling. To round off with this lab, save your clean data to another csv file which we will use in the next lab.</p><pre># save the data in the Data/Clean data/ folder in the project directory.<br># use the .to_csv()<br><br>unicorns.to_csv(&quot;../Data/Clean data/unicorns.csv&quot;, index=False)</pre><h4>6. Key Findings</h4><ul><li>There are 1024 companies represented in this dataset.</li><li>Companies represented in the dataset are companies founded between 1919 and 2021.</li><li>The Fintech industry has the most unicorns.</li><li>The most unicorns are found in North America continent, United States and precisely in the San Francisco city.</li></ul><h4>7. Conclusion</h4><p>In this lab, we explored the dataset using exploratory data analysis, understanding the variables present and their features (characteristics) as well as well as the distributions between variables. We cleaned and structure the data and also visualized the properties of the data.</p><h4><em>What to expect next</em></h4><p>In the next lab, we will use the cleaned data obtained to answer questions such as</p><ol><li>Which companies have the highest return on investment?</li><li>How long does it take companies to become unicorns?</li><li>What is the minimum and maximum number of years each industry took to reach unicorn level</li><li>Which companies had the maximum valuation as per industry</li></ol><p>Answers to these questions will help us give business insights to the investors which will guide them to make informed decisions as to which industries, companies or countries to consider investing based on their objectives and interests.</p><h4>Thanks for reading!</h4><p>And yes, let me know your thoughts in the comments.</p><p>I separated the project into different parts (labs) so that I could set a SMART objective for each lab and complete it within the time frame allocated without being overwhelmed. This I think is the best way to keep motivated and continuously working as I can break down a big goal into small easily achievable goals and have them completed easily.</p><p>Are you a data enthusiast?, let’s connect on <a href="https://www.linkedin.com/in/ndong-henry-ndang-3946ab243/"><strong><em>LinkedIn</em></strong></a></p><p>Want the complete notebook for this project?, get it on <a href="https://github.com/Ndong21/Data_Analysis_python_Unicorn_Companies-"><strong><em>GitHub</em></strong></a></p><p>Part 2 of this project is available <a href="https://medium.com/@ndonghenryndang/unicorn-companies-of-the-21th-century-part-2-42a3b438aa4d"><strong><em>here</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c72c3e9d267" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>