<?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 Urwa Maqsood on Medium]]></title>
        <description><![CDATA[Stories by Urwa Maqsood on Medium]]></description>
        <link>https://medium.com/@urwahmaqsood23?source=rss-52bc81cb02a7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*I6L3zY2HxQLT0kl3ZyVKJA.jpeg</url>
            <title>Stories by Urwa Maqsood on Medium</title>
            <link>https://medium.com/@urwahmaqsood23?source=rss-52bc81cb02a7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 18:05:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@urwahmaqsood23/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[Beginner’s guide to data visualization using python.]]></title>
            <link>https://urwahmaqsood23.medium.com/beginners-guide-to-data-visualization-using-python-62061e382dd0?source=rss-52bc81cb02a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/62061e382dd0</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[seaborn]]></category>
            <dc:creator><![CDATA[Urwa Maqsood]]></dc:creator>
            <pubDate>Mon, 04 Jan 2021 08:07:46 GMT</pubDate>
            <atom:updated>2021-01-04T08:14:10.965Z</atom:updated>
            <content:encoded><![CDATA[<h3>Beginner’s Guide to Data Visualization Using Python.</h3><p>Whichever company or industry you belong from, you most certainly would have heard stories about how data is changing the face of our world. It could be either boosting a company’s revenue, helping medical studies in finding a better cure for a disease or simply increasing productivity and efficiency of a task by strategic resources. All of these have one thing in common, making decisions based on data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*PzAM7DIiF-A_hfwLllV2sQ.png" /></figure><p>Data visualization helps us in making those decisions by providing us with a visual summary of the data to recognize trends which would have otherwise taken way longer if done without any data visualization resources.</p><p>In this article we are going to visualize a dataset of tips collected by a waiter over a course of 244 meals served by him, you can download the dataset from <a href="https://www.kaggle.com/jsphyg/tipping">here</a>.</p><p>First of all lets import all the dependencies that are necessary for this task. We are going to use Seaborn data visualization library in this tutorial.</p><pre>import pandas as pd<br>import numpy as np<br>import seaborn as sns<br>import matplotlib.pyplot as plt</pre><p>Now lets import the data into our notebook.</p><pre>data = pd.read_csv(r&quot;tips.csv&quot;)</pre><p>Let’s test out the data with some basic functions.</p><p><strong>data.head():</strong></p><pre>data.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*YUwvfoSeeI9_doLc77YMcg.png" /></figure><p>The head() method by Pandas provides us with the first five rows of the dataset. Similarly, data.tail() would output the last five rows of the dataset.</p><p><strong>data.columns:</strong></p><p>Now let’s display the name of the columns that this dataset is comprised of. For this we are going to utilize the following method:</p><pre>data.columns</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*bANDs7pC8tVvxI0XAXdnlQ.png" /></figure><p><strong>data.describe():</strong></p><p>Another very useful method by Pandas is describe() that helps in calculating statistical data like mean, percentile, min, max etc of the data.</p><pre>data.describe()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*OGG_LmLjkgwUph91Y_6PyA.png" /></figure><h3><strong>Data Visualization:</strong></h3><p>Let’s start visualizing our data using seaborn, we are going to test out our data with relplots() which has two common approaches of showing the relationship between two parameters: scatter plots and line plots.</p><p><strong>Scatterplots:</strong></p><p>scatterplot() method takes in a number of arguments which includes x (for the values to be plotted on x-axis), y (for the values to be plotted on y-axis), hue (for producing points with different colors), size (for producing different point sizes for categorization) and many more.</p><pre>sns.scatterplot(x=&quot;total_bill&quot;, y=&quot;tip&quot;, hue=&quot;smoker&quot;, data=data);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*BUzdNjjmYETuDTZULpptmQ.png" /></figure><p>This graph represents the tips paid by customers based on their total bills and categorizes them as smokers or non-smoker using hue function. There’s a strong correlation between the total bill and the tip given off. We also observe that most smokers who get a larger bill prefer giving lesser tip than non-smokers who get a larger bill.</p><pre>sns.scatterplot(x=&quot;total_bill&quot;, y=&quot;tip&quot;, size=&quot;size&quot;, data=data);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*WcYtxiVNjarAr3eSr76WMw.png" /></figure><p>This one utilizes the size argument and uses different point sizes to represent the number of people belonging to a certain party while dining in the restaurant.</p><pre>sns.relplot(data=data, x=&quot;total_bill&quot;, y=&quot;tip&quot;,col=&quot;time&quot;, hue=&quot;day&quot;, style=&quot;day&quot;, kind=&quot;scatter&quot;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*nERng3w7KxDawZ4nz7fTgg.png" /></figure><p>With the help of these distributed subplots, we can conclude that there was no lunch served by the waiter on Saturday and Sunday while the largest tip was paid by someone who had dinner at the restaurant on Saturday that was approximately 10$ for a bill of 50$.</p><p><strong>Displots:</strong></p><p>Seaborn’s displot() method uses classic visualizing distributions like histogram to represent the data.</p><pre>sns.displot(data=data, x=&quot;tip&quot;, col=&quot;time&quot;, kde=True)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*fFWW7WM6_PsSW49jJhwyhA.png" /></figure><p>These categorical histograms show us that most recurring tip figure for dinner was around 3.5$ (paid approximately 40 times) and 2.5$ for lunch (paid around 20 times).</p><p><strong>Catplots:</strong></p><p>Catplot() is a relatively new method of seaborn that involves categorical distribution visualization graphs between one, two or more variables.</p><pre>sns.catplot(x=&quot;day&quot;, y=&quot;total_bill&quot;, data=data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*pHCOHJxdqqgG3c_mSFlJJg.png" /></figure><p>This catplot shows the frequency of the bills paid on different days of the week and we can clearly see that the largest amount of bill was paid on Saturday followed by Sunday, Thursday and Friday. We can control the magnitude of the points by the jitter property that controls the distribution of points on the screen. Let’s try turning it completely off:</p><pre>sns.catplot(x=&quot;day&quot;, y=&quot;total_bill&quot;, jitter=False, data=data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*XmYnt01EcVxAOOrGG9YFUw.png" /></figure><p>Here we can see there is no scattering of the frequency points because we turned off the jitter property.</p><p><strong>Bar plots:</strong></p><pre>sns.catplot(x=&quot;smoker&quot;, y=&quot;tip&quot;, hue=&quot;day&quot;, kind=&quot;bar&quot;, data=data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*sAwNmfzf8i3P6bPPzogk2A.png" /></figure><p>This bar plot categorizes the data as smokers and non-smokers and compares the tips paid by them on four days of the week which shows us that the largest tips were paid by smokers on Sundays.</p><p><strong>Box plots:</strong></p><pre>sns.catplot(x=&quot;day&quot;, y=&quot;tip&quot;, kind=&quot;box&quot;, data=data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*jBCSikaSyp1tXDmZ4cbTNw.png" /></figure><p>The above box plot gives us an insight to the tips paid by customers on different days of the week using box and whisker plots mentioning their lowest bottoms as minimum and the highest tips as maximum amount.</p><p><strong>Grouped box plots:</strong></p><pre>sns.boxplot(x=&quot;day&quot;, y=&quot;total_bill&quot;, hue=&quot;smoker&quot;, palette=[&quot;g&quot;, &quot;m&quot;],data=data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*1Cb0qtHI1kuLVUfvUBv_ew.png" /></figure><p>This graph represents grouped box plots which has divided our data into subgroups of smokers and non-smokers and has presented a correlation between the total bill paid by the customers on certain days of the week.</p><h3><strong>Conclusion:</strong></h3><p>In this tutorial we experimented with our data and displayed it using some of the most common graphical techniques to observe certain trends that might stand out for us and all of this was done rather easily using the seaborn library.</p><p>Good data visualization takes complex data and breaks it down graphically in such a way that helps us in understanding our problems and make decisions based on them.</p><p>Thankyou for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62061e382dd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorithm design techniques and their real life examples.]]></title>
            <link>https://urwahmaqsood23.medium.com/algorithm-design-techniques-and-their-real-life-examples-bad97700e07c?source=rss-52bc81cb02a7------2</link>
            <guid isPermaLink="false">https://medium.com/p/bad97700e07c</guid>
            <category><![CDATA[algorithm-design]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Urwa Maqsood]]></dc:creator>
            <pubDate>Mon, 21 Dec 2020 13:14:59 GMT</pubDate>
            <atom:updated>2020-12-21T13:14:59.421Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="types of algorithms" src="https://cdn-images-1.medium.com/max/584/1*D4Bpn3ffGiPAvuEMXkO9xQ.png" /></figure><p>An algorithm is a sequence of instructions written to solve a well formulated problem. Over the past half century, computer scientists have discovered several algorithms that use different approaches to solve a similar problem. We will discuss some of them here along with their real-life applications.</p><h3><strong>Brute Force Algorithms:</strong></h3><p>A brute force search algorithm is the most straightforward way of solving a problem by examining every possible alternative to find a solution of a given problem. They are the easiest algorithms to design as they do not need any prior domain knowledge but are relatively slower for practical problems than other algorithms.</p><blockquote>For example, imagine you have a small padlock with 4 digits ranging from 0–9. Unfortunately, you forgot your password and can not afford a new one so you apply brute force algorithm by setting all numbers from 0000 to 9999 which gives us a possibility of <em>10⁴</em> combinations.</blockquote><h3><strong>Branch and Bound Algorithms:</strong></h3><p>These algorithms are generally used for optimization problems (problems involving finding the best solutions from the feasible ones) in which a root problem is further divided into subproblems which helps in ruling out a large number of alternatives.</p><blockquote>For example, suppose you live in a three story home and want to find a ringing phone which could be anywhere on all of the three floors. If you are standing on the first floor and hear your phone ringing above your head, you can immediately rule out the possibilities of it being in the basement or on the first floor and directly go to the second floor to search for it.</blockquote><h3><strong>Greedy Algorithms:</strong></h3><p>Greedy algorithms are based on a design technique that chooses the next option based on the most obvious and attractive benefit. A greedy algorithm works in two phases</p><p>1. The first phase includes taking what you can get at best right now without thinking about the future consequences.</p><p>2. Hoping that what you chose in the first step will eventually lead to a global optimal solution.</p><blockquote>The greedy algorithm always gives an optimal solution to US currency. For example, you went to a shop and your total was 3.61$. You handed over a 10$ bill to the cashier. Now the cashier will use greedy algorithm to find you a change by selecting the largest possible bill or coin that does not cross the limit.</blockquote><blockquote>1. a $5 bill</blockquote><blockquote>2. a $1 bill, to make $6</blockquote><blockquote>3. a 25¢ coin, to make $6.25</blockquote><blockquote>4. A 10¢ coin, to make $6.35</blockquote><blockquote>5. four 1¢ coins, to make $6.39</blockquote><h3><strong>Recursive Algorithms:</strong></h3><p>Recursive algorithms are the type of algorithms that call themselves by inputting the result of the current step to themselves to eventually come up with a solution</p><blockquote>For example, some of you might have noticed that if you type <a href="https://www.google.com/search?q=recursion&amp;rlz=1C1UEAD_enPK931PK931&amp;oq=recursion&amp;aqs=chrome.0.69i59l2j0l2j0i20i263j69i60l3.4076j0j4&amp;sourceid=chrome&amp;ie=UTF-8">recursion on google</a> there is a “did you mean” clause having the value “recursion” that upon click returns you to the same page. It is kind of an inside joke that by pressing the link you create an infinite loop which will help you in understanding the true meaning and application of recursion</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3nJd_i_nl4VByC9XiBSelg.jpeg" /></figure><h3><strong>Divide and conquer algorithms:</strong></h3><p>Big problems are difficult to solve altogether but if we divide them into smaller ones they become easier and efficient to handle and solve. Divide-and-conquer algorithms do exactly the same. They split a problem into smaller subproblems, solving the subproblems independently, and then combining the solutions of subproblems into a solution of the original problem.</p><p>This technique can be divided into the following three parts:</p><p>1. <strong>Divide: </strong>This involves dividing the problem into some sub problem.</p><p>2. <strong>Conquer: </strong>Sub problem by calling recursively until sub problem solved.</p><p>3. <strong>Combine: </strong>The Sub problem Solved so that we will get find problem solution.</p><blockquote>For example, while solving a puzzle, we always tend to divide the pieces into certain types like left corner, right corner and middle parts and progressively combine the pieces into larger ones until we reach the final result. So this approach also comes under the hood of design and conquer algorithm technique.</blockquote><h3>Randomized algorithms:</h3><p>Randomized algorithms are algorithms that utilizes a degree of randomness in their logic. The output of such algorithms are based on the probabilistic random choices made by algorithm during its execution.</p><blockquote>For example, in cryptography, one time pad (OTP) is an encryption technique that uses randomized algorithm approach to prepare a random secret key to pair with plain text that can not be cracked.</blockquote><h3><strong>Conclusion:</strong></h3><p>We discussed some of the most frequently used algorithm techniques and how they could be applied in our everyday life tasks. It is necessary to develop a good understanding of different design techniques as it will enable us to understand our problems better and apply the right design technique to them.</p><p>Here is the link to my favorite <a href="http://learningalgorithms.tilda.ws/">book</a> about algorithms and their applications.</p><p>Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bad97700e07c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>