<?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 Manjula Mishra on Medium]]></title>
        <description><![CDATA[Stories by Manjula Mishra on Medium]]></description>
        <link>https://medium.com/@manjula.mishra?source=rss-e0146ea95834------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5y_5jvkJwHLm21I6d7VhcQ@2x.jpeg</url>
            <title>Stories by Manjula Mishra on Medium</title>
            <link>https://medium.com/@manjula.mishra?source=rss-e0146ea95834------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 23:18:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@manjula.mishra/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[Most Frequent Python Terms]]></title>
            <link>https://medium.com/swlh/most-frequent-python-terms-bcb2f88f3095?source=rss-e0146ea95834------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcb2f88f3095</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Manjula Mishra]]></dc:creator>
            <pubDate>Thu, 26 Dec 2019 04:29:08 GMT</pubDate>
            <atom:updated>2019-12-26T06:49:49.151Z</atom:updated>
            <content:encoded><![CDATA[<p>Learning the most basic Pythonic terms will come in handy. I remember when I started coding in Python, I had to Google those terms almost all the time. I thought it would be a good idea to document them for my own clarity and also for others who are just starting their journey. Hope you enjoy it!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V8yBElptzfazLoM3HLDn_w.jpeg" /><figcaption>Like any language that we speak, Python has meaning to its terms. Image downloaded from unsplash.</figcaption></figure><p><strong>How does Python work?</strong></p><p>Created by Guido van Rossum, Python has two parts to it:</p><ol><li>Python as a language.</li><li>Python as an implementation.</li></ol><h4><strong>Python as a Language:</strong></h4><p>Python as a language has rules and grammar to write code. Much as in any spoken language, Python defines its own rules around what is an acceptable format of writing code. That format is called syntax. If the syntax is not correct, the system throws a syntax error, think if it as a grammatically incorrect sentence in English.</p><h4><strong>Python as an Implementation:</strong></h4><p><strong>Python as an implementation</strong> is a computer program that understands those rules and then executes the code.</p><h4><strong>Prompt:</strong></h4><p>Three ‘greater than’ &gt;&gt;&gt; signs together are called a prompt. When you see &gt;&gt;&gt;, that means your computer is ready for your Python use. An example:</p><p>&gt;&gt;&gt; 2 + 2</p><p>4</p><h4><strong>Expression:</strong></h4><p>An expression is a piece of code that produces a value. More specifically, if it can be assigned to a variable, or if it can be printed, it’s an expression. For example, these are all expressions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*F9123NNKBATnRtmv0-Fheg.jpeg" /></figure><h4><strong>Statements:</strong></h4><p>An <strong>assignment statement</strong> is to assign something to a variable, e.g.:</p><p>x = 15</p><p>An <strong>expression statement</strong> is something like:</p><p>x = (15 + 20)</p><p>A <strong>simple statement</strong> in Python is a single logical line. Some of the Python simple statement examples are <strong><em>break</em></strong>, <strong><em>continue</em></strong>, <strong><em>return</em></strong> and <strong><em>import</em></strong>.</p><p><strong>Compound statement </strong>consists<strong> </strong>of a group of other statements and usually spread into multiple logical lines. The compound statements are executed when a condition(s) satisfies. Examples are <strong><em>if/else</em></strong>, <strong><em>while</em></strong>, <strong><em>for loops</em></strong>, e<strong><em>xception handling</em></strong> etc.</p><h4><strong>Boolean Expressions: (True/False):</strong></h4><p>True/False are English equivalent of Yes/No. A Boolean expression is a logical expression which evaluates to one of two states: either True or False.</p><h4><strong>Syntax Error:</strong></h4><p>Syntax errors are the most common kind of errors in Python. They are equivalent to a grammatical error in English.</p><h4><strong>Comments:</strong></h4><p>A comment in Python starts with symbol #. A comment can be written in one long line till the end of it. It can also be written in multiple lines with each line starting with #. A comment can also be written next to a statement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*EWD6LdZJWW9XUPlrWAnXjg.jpeg" /></figure><h4><strong>Docstrings:</strong></h4><p>In Python, docstrings are a convenient way of documenting your comments, associated details or explanation related to a function, class, modules, methods etc. You can also use it as a multi-sentence comment. Some of the examples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*Zb0mbfbQeBMoP2fqZ4x14A.jpeg" /><figcaption>The orange inked portion is called a docstring.</figcaption></figure><p>Another example <a href="https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html">from</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*DbewWV-UX2qcB6sZZlyRQA.jpeg" /></figure><h4><strong>IDLE/IDE:</strong></h4><p><strong>IDLE</strong> is integrated development environment (IDE). It’s basically for editing and running <strong>Python</strong> programs interactively. The <strong>IDLE</strong> graphical user interface (GUI) is automatically installed with the <strong>Python</strong> interpreter. <strong>IDLE</strong> was designed specifically for <strong>use</strong> with <strong>Python</strong>. It’s a very widely used tool for Python coding. It comes with editor as well as debugging features. <a href="https://www.quora.com/What-is-IDLE-in-Python">^1</a></p><p>This <a href="https://www.softwaretestinghelp.com/python-ide-code-editors/">website</a> lists following as the best Python IDEs and Editors. I personally use Juypter Notebook/Google Colab for IDEs and VSCode/Sublime Text Editors.</p><p>Top Python <strong>IDEs</strong> :</p><ul><li>PyCharm.</li><li>Spyder.</li><li>Pydev.</li><li>Idle.</li><li>Wing.</li><li>Eric Python.</li><li>Rodeo.</li><li>Thonny.</li></ul><p>Best Python <strong>Code Editors</strong>:</p><ul><li>Sublime Text.</li><li>Atom.</li><li>Vim.</li><li>Visual Studio Code (VSCode).</li></ul><h4><strong>Whitespace:</strong></h4><p>As defined by <a href="https://www.computerhope.com/jargon/w/whitspac.htm">computerhope.com</a>:</p><p>“Alternatively referred to as spacing or <strong>whitespace</strong>, <strong>white space</strong> is any section of a document that is unused or space around an object. White <strong>spaces</strong> help separate paragraphs of text, graphics, and other portions of a document, and helps a document look less crowded.”</p><h4><strong>Indentation:</strong></h4><p>From <a href="https://www.w3schools.in/python-tutorial/concept-of-indentation-in-python/">w3school.com</a></p><p><strong>“Indentation in Python</strong> refers to the (spaces and tabs) that are used at the beginning of a statement. The statements with the same <strong>indentation</strong> belong to the same group called a suite.” Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*itvtJSK_OmEbjOnobh9Jow.jpeg" /></figure><h4>Functions:</h4><p>As taken from <a href="https://www.geeksforgeeks.org/functions-in-python/">Geeksforgeeks</a>:</p><p>“A function is a set of statements that take inputs, do some specific computation and produces output. The idea is to put some commonly or repeatedly done task together and make a function, so that instead of writing the same code again and again for different inputs, we can call the function.<br>Python provides built-in functions like print(), etc. but we can also create your own functions. These functions are called user-defined functions.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*vkoq4dt0WO_Uz2-GG3nVrA.jpeg" /></figure><h4><strong>Built-in functions:</strong></h4><p>Built-in functions in Python are the functions which are always available for you to use such as <strong>print(), help(), min(), max() </strong>etc.</p><h4><strong>Calling a function:</strong></h4><p>Calling a function means executing a function. For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*BzNvmJ7noVhNL9Ian3gauw.jpeg" /></figure><h4><strong>Linting:</strong></h4><p>Linting means analyzing code for potential errors such as syntax errors, other structural errors. Example: print “Hello World”. If you’re using VSCode, it will show as a red underline and also shows the suggestions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*3WQ-qaFEDdg5ZqXQ6Q4CJA.png" /></figure><h4><strong>Debugging:</strong></h4><p>When you run your code (specially complex, multiline codes), there are great chances that you program might run into errors. Finding those errors and fixing them is called is debugging.</p><h4><strong>Unit Tests:</strong></h4><p>A unit test tests if your code is behaving expectedly. It can expose edge cases. Unit tests forces you to think harder about the problem you’re solving and makes you write better codes. More from <a href="https://www.geeksforgeeks.org/unit-testing-python-unittest/">Geeksforgeeks</a>:</p><p>“<strong>Unit Testing</strong> is the first level of software <strong>testing</strong> where the smallest testable parts of a software are tested. This is used to validate that each <strong>unit</strong> of the software performs as designed. The <strong>unittest test</strong> framework is <strong>python’s</strong> xUnit style framework. Method: White Box <strong>Testing</strong> method is used for <strong>Unit testing</strong>.”</p><h4><strong>Code Snippets:</strong></h4><p>This <a href="https://docs.microsoft.com/en-us/visualstudio/ide/code-snippets?view=vs-2019">website</a> explains it well:</p><p><strong>“Code snippets</strong> are small blocks of reusable <strong>code</strong> that <strong>can</strong> be inserted in a <strong>code</strong> file using a right-click menu (context menu) command or a combination of hotkeys. <strong>They</strong> typically contain commonly <strong>used code</strong> blocks such as try-finally or if-else blocks, but <strong>they can</strong> be <strong>used</strong> to insert entire classes or methods.”</p><p>An example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/1*D-7dPU7iEk5bItUEHMFyqw.jpeg" /><figcaption><a href="https://www.pythonforbeginners.com/code-snippets-source-code/date-and-time-script/">https://www.pythonforbeginners.com/code-snippets-source-code/date-and-time-script/</a></figcaption></figure><h4><strong>Variables:</strong></h4><p>A variable is a way to store values in the computer memory. A variable then gives its stored data to the computer for processing. A variable cannot start with a number, it can only start with either a character or underscores. In Python, variable names are case sensitive that means my_var is not same as My_Var.</p><h4><a href="https://www.python.org/dev/peps/pep-0001/"><strong>PEPs- Python Enhancement Proposals:</strong></a></h4><p>These proposal provide documentations and description the way Python language evolves. PEPs are also considered a reference point for acceptable code style and standards in Python.</p><h4><strong>PEP 8:</strong></h4><p>PEP 8 is Python’s style guide for writing code. It provides consistency, styling, formatting and standard for your code quality. For example, indentation (tabs vs four spaces), spacing etc.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcb2f88f3095" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/most-frequent-python-terms-bcb2f88f3095">Most Frequent Python Terms</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basics of Primary Data Structures in Python]]></title>
            <link>https://medium.com/swlh/basics-of-primary-data-structures-in-python-9ffae78a9a05?source=rss-e0146ea95834------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ffae78a9a05</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[basic-python]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Manjula Mishra]]></dc:creator>
            <pubDate>Mon, 16 Dec 2019 03:22:10 GMT</pubDate>
            <atom:updated>2020-04-26T00:02:04.128Z</atom:updated>
            <content:encoded><![CDATA[<p>This post is a basic review of Python data structures. As I started going in depth by understanding the more complex things in Python, I realized that explaining the most basics things to non-programmers (specially recruiters) has become harder! This post is an attempt to define some of the most frequent and common Python-y things.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XXI-kg18liPn4XcfZmoqQQ.jpeg" /></figure><h4><strong>What is Python?</strong></h4><ol><li>Python is an open-source computer programming language which basically means that it’s freely available for anyone and everyone to use. It’s an interpreted, high level and general purpose programming language.</li><li>Python is an <a href="https://en.wikipedia.org/wiki/Object-oriented_programming">object-oriented language </a>: <em>“Object-oriented programming (OOP) is a programming language model in which programs are organized around data, or </em><a href="https://searchmicroservices.techtarget.com/definition/object"><em>objects</em></a><em>, rather than functions and logic.”^</em><a href="https://searchapparchitecture.techtarget.com/definition/object-oriented-programming-OOP"><em>1</em></a></li><li>It has a very readable code format where indentation has a meaning (instead of “begin/end”)</li></ol><h4>What is Python Useful for?</h4><p>Some of the main use cases are:</p><ol><li>Developing web applications.</li><li>Web scrapping.</li><li>Data analysis.</li><li>Machine Learning/AI.</li><li>Visualizations.</li></ol><h4>Basic Data Structures in Python:</h4><p>We’ll be talking about: lists, tuples, dictionaries, sets, and strings.</p><h4><strong>Lists:</strong></h4><ul><li>A list in Python is denoted by square brackets []. Lists are ordered list of elements inside the square brackets and separated by commas. The elements can be any type from integers to strings to real numbers. Lists can have lists, dictionaries inside (we call it nested lists: list of lists ).</li><li>lists are mutable that means the items inside a list can be deleted, more items can be added (append/delete). Thus, the length of a list is changeable.</li><li>The items/elements of a list can be accessed by index. Index, an integer value, is a particular position an element holds, like its address. The items of the list can be accessed either left to right or backwards, right to left. E.g. let’s create a list below:</li></ul><p>example_list = [‘Ron’, 5, ‘Shark’, ‘boy’, 10, 15, 0]</p><p>Below is how indexing works in Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*QrDNS9MWbvF0IkWQf1Z4kg.jpeg" /><figcaption>Indexing of a list: Left to Right and Right to left</figcaption></figure><p>The left to right indexing start at 0. If you type:</p><p>&gt;&gt;&gt; example_list[0]</p><p>output: ‘Ron’</p><p>The same output can also be generated by:</p><p>&gt;&gt;&gt; example_list[-6]</p><p>output: ‘Ron’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*O8WEDhbgxFccbEYopfus4g.jpeg" /><figcaption>Running the same command in <a href="https://colab.research.google.com/notebooks/basic_features_overview.ipynb">Google Colab</a></figcaption></figure><p>You can run for loops, while loops and/or conditionals on lists.</p><h4><strong>Tuples:</strong></h4><ul><li>Tuples uses parenthesis () instead of brackets.</li><li>Tuples can have any number of items and any type of items (integers, real, string). They can also be nested by having list or tuples both inside a tuple.</li><li>Tuples are immutable, that means they can’t be modified (items can’t be added or deleted). The length of the tuple can’t be changed.</li><li>Tuples are useful to group together related data. E.g. Your name, address, age, school, date of birth etc.</li><li>The elements of a tuples can’t be modified directly. But if it’s a nested tuple which has a list inside, the items inside that list can be modified.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*5-kOJ0sSvck03K_f6ywE0g.png" /><figcaption>Since this tuple has a list inside, the item inside that list can be modified (in place of 6, it’s 9 now)</figcaption></figure><ul><li>Same as lists, the items are accessed through indexing.</li></ul><h4><strong>Dictionaries:</strong></h4><ul><li>A dictionary uses curly braces {}. E.g. of a dict (dictionary)</li></ul><p>my_dict = {“name”: “Mary”, “Age”: 21, “address”: “Palo Alto”}</p><ul><li>A dictionary is used to store key value pairs.</li><li>A dictionary is an unordered collection of items. When you retrieve them, the key value pair might have changed position with the dictionary.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*GTnlu8ede-n4vjBY9RiZ5A.png" /></figure><ul><li>They keys of a dictionary must be unique.</li><li>Like lists, dictionaries are mutable. Its length can be changed by adding/deleting items from it.</li><li>Nested dictionary: A dictionary can contain anther dictionary or list or both as values.</li><li>Accessing dictionary items are different than accessing list or tuple items. Dictionary items are accessed via it’s keys.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*70ht0XBwfO2x_yKtgMNAxw.png" /><figcaption>Instead of positional indexing, you use ‘key’ to access the associated value.</figcaption></figure><ul><li>The snapshot below shows how you access the keys of a dictionary using<strong> .keys()</strong> method, or they key value pair by<strong> .items() </strong>or just the values by<strong> .values() </strong>method.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*ex_E9FVJrDdWSumXvpdlOg.png" /></figure><h4><strong>Sets:</strong></h4><ul><li>A set can be declared with curly braces {} or with set([]).</li><li>Like dictionaries , sets are also unordered.</li><li>Much like sets in math, elements of a set in Python are unique, thus no duplicates allowed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*fsgOu85uyr_u-jVcUz4T4Q.jpeg" /><figcaption>Same as in math, a set will not have any duplicates.</figcaption></figure><ul><li>The elements in a set can be of different data type like integers, float, string, None.</li><li>Since sets are immutable, a tuple, which is also immutable, may be included in a set.</li><li>Since lists and dicts are mutable types, they can’t be included in a set.</li><li>Elements of a set are immutable but the set itself is mutable/can be updated. That means the length of a set can be changed by adding another set to it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/1*SPHPXv8ickyWRWyX0Shv8A.jpeg" /><figcaption>The set1 is updated with by adding set2 to it. But it still has only unique values.</figcaption></figure><ul><li>Items of a set can not be accessed using index because sets are unordered and thus they have no index. But you can loop over the set to see the items.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*qEjtMtm2EoJiPhCYHjqBWQ.jpeg" /><figcaption>Accessing items of a set using a for loop.</figcaption></figure><h4><strong>Strings:</strong></h4><ul><li>A string is a sequence of characters (a character is a symbol) and are denoted by either single quotes or double quotes interchangeably. E.g. ‘this is a string’ or “this is a string”.</li><li>Stings are immutable thus, they can’t be changed.</li><li>To access an element of the string, you use indexing (or reverse indexing i.e. right to left that we talked about earlier).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*OO9ukC5tVY_GFvoBvcGXXg.jpeg" /></figure><ul><li>Once a string is assigned, the character of that string can’t be changed however, it can be reassigned to another string:</li></ul><p>my_string = “I love math”</p><p>my_string = “I love Python”</p><p>New string got assigned the same name.</p><p>In this post, we explored a high level understanding of different Python data structure. The next post will talk about the basic operation that we can perform on lists, tuples, dictionaries, sets, and strings. I hope it’s helpful and concise. Thanks for reading! :-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ffae78a9a05" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/basics-of-primary-data-structures-in-python-9ffae78a9a05">Basics of Primary Data Structures in Python</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create PostgreSQL Database on AWS]]></title>
            <link>https://medium.com/@manjula.mishra/how-to-create-postgresql-database-on-aws-dffd027de6f7?source=rss-e0146ea95834------2</link>
            <guid isPermaLink="false">https://medium.com/p/dffd027de6f7</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Manjula Mishra]]></dc:creator>
            <pubDate>Thu, 23 May 2019 05:55:14 GMT</pubDate>
            <atom:updated>2019-05-23T18:51:17.600Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Create a PostgreSQL Database on AWS</h3><h4><a href="https://aws.amazon.com/">Amazon Web Services(AWS)</a> is a great multi-services cloud platform. The services include enhanced computer power to database storage to many others. This post is about how to create and populate a PostgresSQl database on AWS.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*fOEjngNjBfcf1OI6xUBljA.jpeg" /></figure><h4>Common reasons to use AWS PostgreSQL database service:</h4><ul><li>No hassle of setting up server on your local machine</li><li>AWS provides extra storage based on your needs</li><li>Easy set up (once you go through this post)</li><li>You can choose between production vs. development database</li></ul><h4>Some context of our use case:</h4><p>Our project <a href="https://livesafe.netlify.com/"><strong>LiveSafe</strong></a><strong> </strong>survives on our back end data. We used <a href="https://medium.com/@shreyasjothish/deploying-a-flask-application-on-aws-elastic-beanstalk-via-cli-c0e93548472e"><strong>AWS Elastic Beanstalk</strong></a><strong> </strong>service for easier deployment and we also utilized <strong>AWS Database</strong> service to create a PostgreSQL database to upload the data from our local machine to AWS.</p><p>Since the context is a bit clear, let’s talk about the steps involved in actually creating a PostgreSQL database on AWS:</p><h4>Steps to create a PostgreSQL database:</h4><ol><li>Log in <a href="https://aws.amazon.com/"><strong><em>Amazon AWS website</em></strong></a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*_z1GEq2rx0kOMwYZFeHaxg.jpeg" /></figure><p><strong>2.</strong> Once you log in, don’t get overwhelmed by the millions of options you see. Look for<strong> ‘Database’ </strong>category. Click on ‘<strong>RDS</strong>’ (Relational Databases)under the <strong>Database category</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*IPAc127BqtcKLb38qRD_-w.gif" /></figure><p><strong>3. </strong>Once you click on ‘<strong>RDS</strong>’ it take you to the next screen where you click on create database like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*r3d-pgaVpjTn17_QAWw_zA.gif" /></figure><p><strong>4.</strong> Select <strong>PostgreSQL </strong>and click next on the bottom right and go on the next page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*PKN5JLYvl0-52fSwBJPQiQ.gif" /></figure><p><strong>5.</strong> Next screen shows you two options to either choose <strong>production or Dev/Test</strong>. We selected Dev/Test for our purposes. Click next.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*A4OKf6zIzgiJHCaTeNK5og.gif" /></figure><p><strong>6.</strong> The next page is ‘<strong>Specify DB details’</strong>. Leave ‘<em>License model</em>’ and ‘<em>DB engine version</em>’ to default settings. However, you’ll have to choose to how much RAM you want for your database. This will depend on the size of your data. The <em>‘</em><strong><em>Estimated monthly costs</em></strong>’ will depend on your selection<strong>. </strong>Also we selected ‘No’ for ‘<em>Multi-AZ deployment’ .</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*K3vSJDRdo3ZVP2h8KB5Nog.gif" /></figure><p><strong>7.</strong> Leave <em>‘Storage type’</em> and ‘<em>Allocated storage</em>’ to default settings.</p><p>8. On the same page, you will the <em>‘Settings’. </em>Choose a name of the database instance. Don’t confuse it with database name (we’ll be choosing database name in a moment. That database will live in this DB instance). Also choose a Master username and password. Save the user/password info somewhere safe, you will need it when we populate the database later in next post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*raRszoY_pgkU3AevA1IR1Q.gif" /></figure><p><strong>9.</strong> On the next page, you will see <em>‘</em><strong><em>Configure advanced settings</em></strong><em>’. </em>Leave everything else to default except for<em> ‘</em><strong><em>Public accessibility</em></strong><em>’. </em><strong>Select <em>‘Yes’.</em></strong><em> </em>If you select <em>‘No’</em>, you wouldn’t be able to populate your database as it’s not accessible to establish any connections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*b5xiuA9mWeUngm1lckPTdw.gif" /></figure><p><strong>10.</strong> Next step on the same page is <em>‘</em><strong><em>Database options’</em></strong><em>. </em>You are supposed to choose a database name. I like to keep it descriptive because you can have multiple databases under single database instance. Descriptive names will make it easier to remember what data is stored under each database name. I also disabled <em>‘IAM DB authentication’, </em>however you can check the other option if you like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*vdv5zosfMwqact-4t_ocXQ.gif" /><figcaption>,</figcaption></figure><p><strong>11.</strong> On the same page, leave <em>‘Encryption’ </em>and<em> ‘ Monitoring’, </em>to the default settings. For <em>‘</em><strong><em>Backup</em></strong><em>’, </em>you can select the number of days AWS<em> </em>RDS should retain automatic backups of you DB instance. I left it to 7 days but you should select a number depending on your need and importance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*cijURhxatsbAvIIpJdKXDQ.gif" /></figure><p><strong>12.</strong> Still the same page, leave mostly everything to default settings except if you want to export logs. I selected ‘<strong><em>postgresql logs’</em></strong>. And the last important check mark is if you want <em>‘</em><strong><em>Deletion Protection</em></strong><em>’. </em>Select yes if you don’t want anyone or yourself to be able to delete your database with one click. Basically if you click yes but later you want to delete it, you will have to change the settings before you are given permissions to do so.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*OEez9xzfFeMVume0nMcaJg.gif" /></figure><p><strong>13. </strong>Aaand you are DONE! You can safely click, <strong><em>‘Create database</em></strong><em>’ </em>on the bottom right corner. Make sure that you choose the right region for your service otherwise it will give an error saying it can’t create a database for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*5Y30N9yTjUroQUEX2omscQ.gif" /></figure><p><strong>14.</strong> Now you can click to view your newly created DB instance. Click Database on the left side panel. You should be able to see your database name here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FvQknicxYqsmxp88cdKuQg.jpeg" /></figure><p>Once you click the highlighted database name, it take you to the page below. The important information that you’ll need for populating the database can be found under<em> ‘</em><strong><em>Connectivity &amp; security</em></strong><em>’ (end point and port) </em>and ‘<strong><em>Configuration</em></strong><em>’ (database name etc).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*5HG_a9E-81oiVvaZaM_G7g.gif" /></figure><p><strong>15.</strong> If for some reasons you want to modify your database details. Go back to your database and click Modify button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*EqT2JvkuVkevFFImycj9zQ.gif" /></figure><p><strong>16.</strong> If you want to delete the database, you click on the Action drop down menu and select ‘Delete’. However, since we selected ‘Deletion Protection’, It wouldn’t let you delete it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*FvdrI187CmDHkjiaXCiEeg.gif" /></figure><p>Thus, you will have to click Modify and then deselect the deletion option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*GugpetYCeImptlBSqn1_9Q.gif" /></figure><p><strong>17.</strong> Once you have modified your database, you can safely go and choose to delete your database.</p><p>Hope it was a helpful read. I found it overwhelming to read through Amazon documentation. However, once you follow the steps, it’s quite easy to understand the setup flow.</p><p>This was done in collaboration with <a href="https://medium.com/@shreyasjothish">Shreyas Jothish</a> and <a href="https://www.martinalarcon.org/">Daniel Martin-Alarcon</a>, two of my best data science teammates. The next post will be about how to establish connection (using Python Juypter notebook) to AWS database we just created and how we populate it with our data. Thanks everyone! :-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dffd027de6f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predicting Functional Water Pumps in Tanzania using Random Forests and Logistic Regression in…]]></title>
            <link>https://itnext.io/predicting-functional-water-pumps-in-tanzania-using-random-forests-and-logistic-regression-in-ffa04b0617f2?source=rss-e0146ea95834------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffa04b0617f2</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[random-forest]]></category>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[water-pumps]]></category>
            <dc:creator><![CDATA[Manjula Mishra]]></dc:creator>
            <pubDate>Fri, 08 Feb 2019 17:45:35 GMT</pubDate>
            <atom:updated>2019-02-12T18:12:02.921Z</atom:updated>
            <content:encoded><![CDATA[<h3>Predicting Functional Water Pumps in Tanzania using Random Forests and Logistic Regression in Python</h3><p>For baseline model and initial Logistic Regression for the same dataset, please see the second attached jupyter notebook at the end of the post</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wnwVCT333Ke-4mQ4.jpg" /><figcaption>Local children pump ground water in the Mara River Basin, Tanzania. © Ana Lemos 2016 <a href="http://maraselva.fiu.edu/en/fetching-water-on-a-saturday-morning/">http://maraselva.fiu.edu/en/fetching-water-on-a-saturday-morning/</a></figcaption></figure><p><a href="https://www.kaggle.com/manjulamishra/water-pumps-random-forest-model-and-plots">This whole week, I have been working on Tanzania’s water pumps data for an in-class Kaggle challenge</a>. ‘Tanzania’s water pumps’ is an interesting dataset. The target variable consists of three classes of water pumps: Functional, Non-function, and the ones that require repair work. This is a classic classification problem of how to accurately predict the classes. The challenge was if we can predict which pumps are functional.</p><p>The dataset is decent size but requires some serious cleaning. Except for a few numerical variables, most of the features are categorical. The numeric features aren’t very helpful given the number of missing values they have. However, they are important enough not to be thrown away. On the other hand, categorical variables don’t have many missing values in comparison to numerical features, but almost each of them represents at least hundreds of categories. For example: the feature <em>‘wpt_name’</em> has 45600 types of names.In the attached notebook you will see:</p><ol><li>Manual cleaning because I wanted to hand pick the number of categories which represented the most information (also to prevent my laptop from crashing).</li><li>pandas dummy encoding of categorical variables</li><li>Decision tree model</li><li>Random forests model</li><li>Cool visualizations!</li><li>Attached jupyter notebook.</li></ol><p>Let’s first see the number of functional, non-functional, or the pumps that require repair work:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*jGZUU1QnvGT_8MUBEc4Okw.png" /></figure><p>We can also the different classes of pumps in different basins:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c74100eb07ff1c77b423c7fd2593bb1a/href">https://medium.com/media/c74100eb07ff1c77b423c7fd2593bb1a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*2fIK6M6SDfzYh4tz95-ClQ.png" /></figure><p>One another interesting insight is checking the functionality against the type of water:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fac076bff6be0dbc453bb82b6d21d6c1/href">https://medium.com/media/fac076bff6be0dbc453bb82b6d21d6c1/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*idpRez_NPeb0hYCJtujvpg.png" /></figure><p>Let’s see some examples of manual cleaning (for more, please see the attached notebook):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d5a5bf56eecdecffbc1cc15b6b04ec9/href">https://medium.com/media/1d5a5bf56eecdecffbc1cc15b6b04ec9/href</a></iframe><p><strong>Decision Tree:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/982b4e412578dd31e19e2d9ea439be90/href">https://medium.com/media/982b4e412578dd31e19e2d9ea439be90/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*hO7Nf-KotFzIY8v3uMisNA.png" /></figure><p><strong>Random Forests:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ff459f523b6c7136491bb2f97d6ef5d/href">https://medium.com/media/7ff459f523b6c7136491bb2f97d6ef5d/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*snsaX015Mlt3avtsk_7YtQ.png" /></figure><p>This is a decent test accuracy score. I don’t want to overfit the model given it’s a Kaggle competition meaning, we wouldn’t know the accuracy of our predictions against the ground truth until the private board results are out. Happy to report that the accuracy score on the <a href="https://www.kaggle.com/c/ds1-predictive-modeling-challenge/leaderboard">private leaderboard</a> (RF accuracy score: 0.80846) was very consistent with my <a href="https://www.kaggle.com/c/ds1-predictive-modeling-challenge/leaderboard">public leaderboard </a>(RF accuracy accuracy score: 0.8090235).</p><p>Some cool visualizations from the notebook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de23fca9e60acd576185fd9f76f4e317/href">https://medium.com/media/de23fca9e60acd576185fd9f76f4e317/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*0-w2h5c6HrEktRXkvreW1Q.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a69295ae9143dc0214ede0469f4e7112/href">https://medium.com/media/a69295ae9143dc0214ede0469f4e7112/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*caXqsCurdByGuEsriFKBRQ.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d5711b6afa12428b5a9a735541817e97/href">https://medium.com/media/d5711b6afa12428b5a9a735541817e97/href</a></iframe><p>Baseline Models and Logistic Regression in the attached notebook below:</p><ol><li>Baseline with mode</li><li>Class imbalance</li><li>Logistic regression with only numeric features</li><li>Logistic regression after encoding categorical features</li><li>Logistic regression with encoded categorical features and using standard scalar from sklearn</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a97e0257387d88baa39f65d05e0bc87/href">https://medium.com/media/5a97e0257387d88baa39f65d05e0bc87/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffa04b0617f2" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/predicting-functional-water-pumps-in-tanzania-using-random-forests-and-logistic-regression-in-ffa04b0617f2">Predicting Functional Water Pumps in Tanzania using Random Forests and Logistic Regression in…</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Metropolitan Trends Analysis for Home Improvement Spending in 2015 and Projection for 2017]]></title>
            <link>https://medium.com/data-science/metropolitan-trends-analysis-for-home-improvement-spending-in-2015-and-projection-for-2017-ca2a8609ceba?source=rss-e0146ea95834------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca2a8609ceba</guid>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[plotly]]></category>
            <category><![CDATA[housing-market]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Manjula Mishra]]></dc:creator>
            <pubDate>Wed, 26 Dec 2018 03:21:53 GMT</pubDate>
            <atom:updated>2020-02-05T18:12:43.023Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NI9v47AHXmtwu2jv2cvWCg.jpeg" /></figure><h4>Analysis in Python Pandas and Graphs in Plotly &amp; Seaborn</h4><p><strong>The Data Set</strong>: from <a href="http://www.jchs.harvard.edu/research-areas/reports/demographic-change-and-remodeling-outlook">Joint Center for Housing Studies at Harvard</a>. I used a subset of the same data set in my <a href="https://medium.com/@manjula.mishra/home-remodeling-analysis-turned-excel-data-handling-in-python-e1115f8302e4">previous post</a> published in <a href="https://towardsdatascience.com/">Towards Data Science</a>.</p><p><strong>Features of Interest in This Data Set:</strong></p><ul><li>25 US metropolitan areas</li><li>Median income: 2015</li><li>Median home value: 2015</li><li>‘Discretionary’ (kitchen, bathroom, room additions, and outside attachments), ‘Replacement’(exterior, interior, and system and equipments), and ‘Other’(disaster repair, improvements to lot or yard) home improvement expenditure categories</li><li>Total expenditure on home improvement in 2015</li><li>Projected Real Annual Percent Change, 2017</li></ul><p><strong>Key Takeaways From My Analysis:</strong></p><ul><li>Interactive graphs for a closer look at the numbers</li><li>Discretionary and replacement spending show negative relation</li><li>Median home value and median income are (obviously) highly correlated related</li><li>Average expenditure per owner (on home improvement) and median home value don’t tell the whole story</li><li>2015 home improvement expenditure trends and 2017 projected</li><li>Correlation matrix</li><li>Attached Jupyter notebook at the end to see the raw work</li></ul><p>Let’s start digging into analysis now. Below is the correlation matrix table for various features. It’s interesting to see a <strong>negative correlation</strong> between median income and percent of expenditure on replacement category, while median income and expenditure on discretionary home improvement shows a <strong>positive correlation</strong>. Does it mean more people like remodeling their kitchen/bath/ or add another room/outdoor attachment as their income increase? Or items on replacement category do not need to changed? Or homeowners like modernizing their homes as the income increases? Interesting hypotheses, but I didn’t analyze enough data to conclude any of that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2htkeMxlwwN8jrk5DBBbQ.png" /></figure><p>The graph below shows the intensity of correlations. Some of the negative correlations are surprising to me. For example, median home value and expenditure on replacement category. It will be interesting to investigate if spending on beautifying the interiors like kitchen or/and adding more rooms drives the home value up. This is out of scope of my analysis in this post.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*PbaBFFVM7fO2XAT2sSpokg.png" /></figure><p>First graph show a clearly negative relationship between discretionary versus replacement expenditure percentages. Discretionary expenditure includes kitchen, bathroom and outdoor patio etc, while replacement expenditure consists of items like roofing, windows, insulation. From the chart, it looks like that homeowner can afford/choose to spend on either one category not both.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F10%2Fmetro-area-discretionary-vs-replacement-spending-2015%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F10.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/f2dc470ef3994a899fede08eaa8ead74/href">https://medium.com/media/f2dc470ef3994a899fede08eaa8ead74/href</a></iframe><p>Some metropolitan areas are more expensive/valued more than the others. It’s clear that cities with higher median income have more expensive housing.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F24%2Fmedian-home-value-median-incomes-2015%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F24.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/08a62e30e7a7b7c0efaccf2e3766bd5c/href">https://medium.com/media/08a62e30e7a7b7c0efaccf2e3766bd5c/href</a></iframe><p>Since we just talked about the median home value and incomes, it would be interesting to see the average per home owner spending on home improvements in the same metropolitan areas. Looking at the graph, the average per owner spending looks flatter.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F12%2Fmedian-home-value-vs-average-expenditure-per-owner-on-home-improvements2015%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F12.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/08bf0a65b5cce4656347836a5344c2db/href">https://medium.com/media/08bf0a65b5cce4656347836a5344c2db/href</a></iframe><p>The above graph doesn’t show average per owner spending very clearly. So I plotted it below :</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F20%2Faverage-per-owner-spending-2015%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F20.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/9992b44ee828a0777a248611596d6974/href">https://medium.com/media/9992b44ee828a0777a248611596d6974/href</a></iframe><p>The home improvement spending in 2015 and projections for 2017 almost perfectly overlaps for all 25 metropolitan areas. It’s both good or bad news for the businesses. Good news because the market looks stable without any shock and speculation, but on the other hand it also means less chances of extra growth or spurt in the market.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F18%2Fmetro-area-2015-total-home-improvement-expenditure-vs-2017-projected%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F18.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/a02e7c429ea4d4106e3f86e72b7fe514/href">https://medium.com/media/a02e7c429ea4d4106e3f86e72b7fe514/href</a></iframe><p>The above graph compelled me to plot the projected real annual percentage change in the graph below. Milwaukee, WI and Kansas City, MO project the highest growth while Houston, TX and and Miami, FL show negative projections.</p><iframe src="https://cdn.embedly.com/widgets/media.html?url=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F16%2Fprojected-real-annual-percent-change2017%2F&amp;src=https%3A%2F%2Fplot.ly%2F%7Emanjulamishra%2F16.embed%3Fautosize%3Dtrue&amp;type=text%2Fhtml&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;schema=plot" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc50035342b8fdc646e12e595fbeb7ab/href">https://medium.com/media/fc50035342b8fdc646e12e595fbeb7ab/href</a></iframe><p>My Jupyter notebook showing the dataset and raw work.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/73bf4a9df97bf7064624290e36da9e1a/href">https://medium.com/media/73bf4a9df97bf7064624290e36da9e1a/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca2a8609ceba" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/metropolitan-trends-analysis-for-home-improvement-spending-in-2015-and-projection-for-2017-ca2a8609ceba">Metropolitan Trends Analysis for Home Improvement Spending in 2015 and Projection for 2017</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Home Remodeling Analysis Turned Excel Data Handling in Python]]></title>
            <link>https://medium.com/data-science/home-remodeling-analysis-turned-excel-data-handling-in-python-e1115f8302e4?source=rss-e0146ea95834------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1115f8302e4</guid>
            <category><![CDATA[home-remodeling]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[python-pandas]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Manjula Mishra]]></dc:creator>
            <pubDate>Fri, 14 Dec 2018 19:52:42 GMT</pubDate>
            <atom:updated>2018-12-27T01:23:46.455Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0XkpXW-lHwZbCM3qiSok6A.jpeg" /></figure><h4>Why cleaning data is the most important step</h4><p><strong>Original Project Mission</strong>: Find interesting insights to see where the remodeling market is headed</p><p><strong>Project Mission (Twist): </strong>How to handle well manicured excel data in Python (spoiler: neat is a deceptive word)</p><p><strong>Timeline</strong>: One week (I tell you if you’re new to DS like me, one week is <strong>not</strong> enough)</p><p><strong>Project Findings for the Original Goal </strong>:</p><ul><li>The numbers look stable with some reshuffle in priorities</li><li>Average costs are considerably higher than national average in/around Palo Alto, CA</li><li>States where the biggest Full Services remodeling companies are located</li></ul><p><strong>Finding on Data Handling: </strong>There is a solution in Pandas (Python), life is not hopeless yet!</p><p><strong>Data</strong>: Exploring publicly available data from different sources — <a href="http://www.jchs.harvard.edu/research-areas/reports/demographic-change-and-remodeling-outlook">Joint Center for Housing Studies at Harvard</a>, <a href="https://www.remodeling.hw.net/benchmarks/remodeling-550/the-2017-remodeling-550-list_o?bwts=1544475223">Remodeling magazine</a>, and obtaining average project costs for local area in and around Palo Alto, CA from <a href="http://hinkle-construction.com/project-costs/">Hinkle Construction Inc</a>’s web page.</p><p><strong>Method</strong>: Python — data wrangling, basic statistics and visualization using mainly Pandas, Matplotlib, Seaborn.</p><p>The sequence for this post will be to first talk about the results we got from the home remodeling data. Later, we will go through the data cleaning struggles as well.</p><p>The graphs below show national average spending on different categories of home improvements. The data shows that ‘Room Additions’ is the most popular category. In last 15 years, the spending in this category peaked in 2005 at ~$25k in average expenditure. The lowest point was in 2011 with spending going down to below $12k. The market seems to be recovering since then. From 1995–2005, homeowners spending on room additions increased by more than 62% in 20 years. Another relatively bigger change is in kitchen remodeling where the expenditure doubled in from 1995 to 2015 and peaking in 2007.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*4efVNTnFcGOVQE1BN92O5w.png" /><figcaption>Source: <a href="http://www.jchs.harvard.edu/research-areas/reports/demographic-change-and-remodeling-outlook">Joint Center for Housing Studies at Harvard</a></figcaption></figure><p>When I got the above results, I was curious to know the average homeowner expenditures in my local area where I live. Given the time constrain, I couldn’t find the data directly comparable to the graph above but the average of the those projects in our area.</p><p>The bar graph below depicts the average costs of different types of home improvements in and around Palo Alto, California. The costs are significantly higher than the national averages. Adding a new room, 144 square feet in size, costs more than $50k. Major kitchen remodeling is also equally expensive at $50k.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhKUuCD3WyjP1wH4FC-qWA.png" /><figcaption>Source: <a href="http://hinkle-construction.com/project-costs/">Hinkle Construction Inc</a>’ website</figcaption></figure><p>For the first two plots, please check the attached python file, if interested.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/447deab5a849aea6724607c7ace78d36/href">https://medium.com/media/447deab5a849aea6724607c7ace78d36/href</a></iframe><p>I was compelled to find out who were the biggest players in the remodeling industry. ‘Remodeling Magazine’ conducts intensive research in this field. The Remodeling 550 division of the magazine collects the data and announces the winners in remodeling business based on the previous years revenues. In their own words: “<em>The 2017 </em><a href="https://www.remodeling.hw.net/benchmarks/remodeling-550/"><em>Remodeling 550</em></a><em> comes in four lists, each represented in a tab below and showing who’s who among full-service remodelers, replacement contractors, insurance restoration companies, and franchisors. Companies are ranked based on their 2016 revenue generated from remodeling; not by the company’s gross revenue</em>.”</p><p>I only looked into 2017’s Full service companies. The ranking was based revenues earned in 2016 (the list for 2018 is not out until May, 2019).</p><p>The bar chart shows 15 most prominent companies (out of total 340) in remodeling business across the country.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*0ay3evZCGBvotsxo1vEoeQ.png" /><figcaption>Source: <a href="https://www.remodeling.hw.net/benchmarks/remodeling-550/the-2017-remodeling-550-list_o?bwts=1544475223">Remodeling magazine</a></figcaption></figure><p>Unsurprisingly, a good number of those companies are based in California.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*MrzYqWE4mIV-iHaTJoPJLw.png" /><figcaption>Source: <a href="https://www.remodeling.hw.net/benchmarks/remodeling-550/the-2017-remodeling-550-list_o?bwts=1544475223">Remodeling magazine</a></figcaption></figure><p>The last plot is just for fun. I ran a correlation matrix to see how revenues, ranking and other variables are related to each other. Shades show the intensity of the correlation coefficients. For example: ranking (‘#’) and revenues are highly negatively correlated. Don’t get confused here. We all know how ranking works: lower the number, better the ranking (1 is the best). So, higher the revenue, lower the number (say 1) which means higher the ranking.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*BIvxMmgr8iKPBDwsqZQofQ.png" /></figure><p>Below is my work in Jupyter Notebook for the above plots.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fb02ffe9c80b051d0dbfe966323c49a/href">https://medium.com/media/2fb02ffe9c80b051d0dbfe966323c49a/href</a></iframe><p>Now, let’s talk about the data wrangling/cleaning struggle part as promised. Some background on the data I collected for this project:</p><ul><li>I downloaded a lot more data then I actually need/could process in time</li><li>I though more data would always mean better results</li><li>Nice, neat looking data in excel would mean less cleaning in Pandas/Python. WRONG! Mistake no. 1.</li><li>My data was spread over 26 Excel sheets in 4 different files(I’m not kidding)</li></ul><p><strong>Problems in a neat looking Excel sheet: </strong>These are ones I faced, so beware, there might be even more I haven’t come across yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K126URp1tmOn5ePD5U1aKw.png" /><figcaption>Impressively neat excel data</figcaption></figure><ul><li>Empty cells: Excel is more flexible when it comes to leaving cell empty but your Pandas read function isn’t going to like it. It’s laughing at you like “Told ya, Deal with the NaNs now!”</li><li>The header: A clean header in excel doesn’t necessarily mean anything in Pandas. You check the actual columns names and don’t be surprised that the actual column names were way different than what’s being shown in the excel header! Change column names. More the number of columns more the work.</li><li>Another similar problem when you have column names for all columns except for the first one (in excel it will still make sense specially if it’s a categorical variable column) but operating on such a column is a problem in Pandas framework.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f5lKVtMdVmbf59U-G4rI5g.png" /></figure><ul><li>Ah! those neat looking numeric values! Don’t be fooled. You will have deal with Every. Single. Extra. Thing. you have in between the numbers. Be it a dollar ($) sign, comma etc. Pandas reads it as an object and that a problem. You would not be able to achieve any statistical/mathematical goal with that. You have to convert it to int/float to make it usable.</li></ul><p><strong>What I Learned from this Project:</strong></p><ul><li>Think about the timeline and don’t be extra ambitious. Choose a doable data set. Instead of choosing multiple data sets, choose one and think about how many ways you can manipulate/analyze it.</li><li>Prioritize your work around the project deliverable. When you are stuck in my situation of lots of fragmented data, re-prioritize your objectives and follow inverted pyramid principle: do the work that’s most important first.</li><li>You don’t always have to convert your excel files into .csv. There is an easier way to import the desired sheet directly. All it needs is a working path name.</li><li>Ask for help. As a beginner in Python, I’m struggling more often than I would like to. But asking your peers/instructors/managers for help might provide you valuable insights and multiple solutions for the single problem.</li><li>When you are stuck, it feels easier to go back and fix the problems in excel than to spend time figuring it out in Python. But, I tell you, it’s rewarding to not give and get it done the right way in Pandas.</li><li>You need to know what visualizations are appropriate for your data. There are cool visualization libraries in Python but none of the cool graphs work for your data and that’s ok. When see big errors, don’t ignore it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JxdUnHAZIVstG1GjjlTpWA.png" /></figure><p>In the graph above, I’m trying to plot all 340 remodeling companies, their revenues, no. of jobs, and average job price. It’s invalid comparison type. respect the errors and dig deeper to know what kind of plot is more suitable for your data representation. Simple don’t mean bad as fancy doesn’t always mean better (ok, may be grapes are sour in this case as I couldn’t get a fancies plot, but I mean what I say).</p><p>For me, this first project was a big learning curve. But I came out as a stronger, better prepared Data Scientist in training who will never look at excel data sheets in the same light ever again. :-)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1115f8302e4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/home-remodeling-analysis-turned-excel-data-handling-in-python-e1115f8302e4">Home Remodeling Analysis Turned Excel Data Handling in Python</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blending Economics with Data Science]]></title>
            <link>https://medium.com/@manjula.mishra/blending-economics-with-data-science-6b4ee4d4f62f?source=rss-e0146ea95834------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b4ee4d4f62f</guid>
            <category><![CDATA[economics]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Manjula Mishra]]></dc:creator>
            <pubDate>Tue, 27 Nov 2018 23:56:33 GMT</pubDate>
            <atom:updated>2018-11-30T20:26:43.516Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rjlQ_fHUS2VdIHMK0EMZRQ.jpeg" /></figure><p>A few months ago, I was helping my husband in conducting some data driven research for his product. The research involved finding necessary data to understand the product market. And based on that, proposing a business plan. He trusted my good enough degrees in economics and my analytical brain. Yet, my theoretical knowledge in economics domain wan’t enough. The lack of training in data science made it harder for me to conduct good analysis. The task needed a lot deeper understanding of data handling than I thought I would. Anyway, our friend from Columbia university saved us, of course!</p><p>Enough was enough. It became now or never. I, finally, joined an intensive Data Science journey about a few weeks ago. It’s a tough journey for sure but satisfying at the same time. Everyday is a new learning adventure with results.</p><p>Learning data science has been on my priority list even before I knew it was a big thing. All along, I always needed it. To name a few: Monetary economics, Econometrics, World development and growth etc.</p><p>My class presentations, write ups, and research papers would have been higher quality. But computer languages, in my mind, were only for engineers.</p><p>As a family, we moved a lot. While it was fun to live in different countries/cities, it didn’t prove to be great for my career. My husband would get a job at places with more computer scientists than people with skills like mine. Most relevant job descriptions included masters in economics. But they also needed in-depth knowledge of Python, R, SQL a.k.a data science.</p><p>I’m focused in areas like economic growth, human capital, environmental issues and sustainability . Housing industry was a new addition to my list after moving to the Bay Area a few years back. I procrastinated writing on Bay Area housing crisis for a long time. The reason being how to back up my stories with good data analysis?</p><p>With my new data science journey, I’m moving in the right direction. I’m realizing that data science provides you a set of tools which makes you powerful in your own field. Above all, you can step out of the theoretical world. You can prove with facts. Facts collected through analysis, and visualizations. And include it all in nice writeups for wide variety of audience!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b4ee4d4f62f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>