<?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 Prabhakar Pandey on Medium]]></title>
        <description><![CDATA[Stories by Prabhakar Pandey on Medium]]></description>
        <link>https://medium.com/@datageek-prabhakarpandey?source=rss-1f060b72acc7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*l13_mrvPKthI_dI3yUsvSg.jpeg</url>
            <title>Stories by Prabhakar Pandey on Medium</title>
            <link>https://medium.com/@datageek-prabhakarpandey?source=rss-1f060b72acc7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:05:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@datageek-prabhakarpandey/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[5 Major Misconceptions about Life]]></title>
            <link>https://datageek-prabhakarpandey.medium.com/5-major-misconceptions-about-life-ff96e1659ee4?source=rss-1f060b72acc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff96e1659ee4</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[happiness]]></category>
            <category><![CDATA[misconception]]></category>
            <category><![CDATA[emotions]]></category>
            <category><![CDATA[mental-health]]></category>
            <dc:creator><![CDATA[Prabhakar Pandey]]></dc:creator>
            <pubDate>Wed, 14 Apr 2021 19:45:17 GMT</pubDate>
            <atom:updated>2021-04-14T20:01:00.739Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Life is the experience or state of being alive. Life is an expedition where many people come into our life, some as a blessing and some as a lesson.</strong></p><blockquote>Life is not about victory or defeat, life is about learning new things every day, everywhere.<br>Experience of life for everyone is not same but everyone experience up’s and down’s and believe me it makes the life worth living.</blockquote><figure><img alt="Life Quote" src="https://cdn-images-1.medium.com/max/724/1*LsAbBnvlUAeYCc9PIKcGsw.png" /></figure><blockquote><strong>Fallacy</strong></blockquote><p><strong>Most of the time people create an incorrect conclusion or wrong understanding about life like:</strong></p><p><strong>There is a correct way to live</strong></p><blockquote><strong>There is no unerring way to live. Everyone has their principles and beliefs. Don’t let anyone drive you how to live your life.</strong></blockquote><p><strong>Everything happens for a good reason</strong></p><figure><img alt="Crime &amp; Grief" src="https://cdn-images-1.medium.com/max/561/1*jeRYiyRI9KoHRYwhVgi3gQ.png" /></figure><blockquote><strong>Everything that happens in someone’s life or even in the world does not happen for a good reason or cause. For say a murder, rape or a terrorist attack have no virtuous cause.</strong></blockquote><p><strong>Life will change overnight</strong></p><figure><img alt="Miracle" src="https://cdn-images-1.medium.com/max/662/1*fnlxSfc4NU1QNYP_rw8r9A.png" /></figure><p><strong>Procuring something will make life convalescent</strong></p><blockquote><strong>Materialistic things never gratify anyone in life. It only satisfies our appetite for greed. It’s a wrong belief that possession of any material, gadget, money, house, or car will give you happiness. Real happiness comes where satisfaction lies.</strong></blockquote><figure><img alt="Happiness" src="https://cdn-images-1.medium.com/max/479/1*eXIZuGyKaHpYK1AiRo_-Hw.png" /></figure><p><strong>Vulnerability is a sign of flimsy</strong></p><blockquote><strong>We are learned to quell our feelings rather than being understood why we are feeling so or what we hanker to say.</strong></blockquote><blockquote><strong>This induces us to unhealthy emotional and cerebral lesion which lies inside us in our innermost.</strong></blockquote><figure><img alt="Life’s Emotion" src="https://cdn-images-1.medium.com/max/584/1*6pPw_iqtU-cbZE3_r0w1rg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff96e1659ee4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Data Analysis-Exploratory Data Analysis (EDA) in Pandas]]></title>
            <link>https://datageek-prabhakarpandey.medium.com/python-data-analysis-exploratory-data-analysis-eda-in-pandas-19a4e1064d53?source=rss-1f060b72acc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/19a4e1064d53</guid>
            <category><![CDATA[pandas-profiling]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[pandas-dataframe]]></category>
            <dc:creator><![CDATA[Prabhakar Pandey]]></dc:creator>
            <pubDate>Sat, 19 Sep 2020 16:37:59 GMT</pubDate>
            <atom:updated>2020-09-19T17:11:50.338Z</atom:updated>
            <content:encoded><![CDATA[<h4>Pandas Profiling- Get your hands clean with dirty data</h4><blockquote><strong>Know Your Data’s Power using Pandas Profiling</strong></blockquote><figure><img alt="Exploratory Data Analysis (EDA) in Pandas" src="https://cdn-images-1.medium.com/max/1024/1*HldH9VhYJqLx4nLJItxqfQ.png" /><figcaption><strong>Exploratory Data Analysis (EDA) in Pandas</strong></figcaption></figure><p>When we get a new data set, the first thing we do is to get an understanding of the data. We do basic data analysis with data using Pandas or NumPy lib, In steps we understand pattern in our data before doing more elaborate analyses such as customized EDA or modeling. We determine number of unique values, identifying the data type, as well as percentage of missing values for each variable.</p><p>With huge amount of data we think, how to do simple, fast and yet very powerful exploratory data analysis (EDA) then we come around Pandas Profiling Package to get a simple fast powerful data analysis within a second to know the power of our data.</p><p>When we talk about the Exploratory Data Analysis (EDA), its play a vital role to understanding the datasets. If you are going to build a Machine Learning Model or wants to bring out some info insights from the data, EDA is the first step task to perform.</p><blockquote><strong>Steps to perform EDA- Python Pandas Profiling:</strong></blockquote><blockquote><strong>How to install pandas-profiling</strong></blockquote><blockquote><strong>Option 1</strong>: <strong>Using pip</strong></blockquote><blockquote>You can install using the pip package manager by running</blockquote><blockquote><em>Pip install pandas-profiling</em></blockquote><blockquote><strong>Option 2</strong>: <strong>Using conda</strong></blockquote><blockquote><em>conda install -c conda-forge pandas-profiling</em></blockquote><blockquote><strong>How to Use pandas-profiling</strong></blockquote><blockquote>Once we have installed the package, Now we need to import the package in the environment</blockquote><blockquote><em>import pandas_profiling</em></blockquote><blockquote><strong>Keep in Mind:</strong></blockquote><blockquote><strong>Pandas-profiling</strong> generates profile reports (.html or other extensions) from a pandas <strong>DataFrame</strong>. As we know, the pandas <strong>df.describe()</strong> function is great but a little basic for serious exploratory data analysis. <strong>pandas_profiling</strong> extends the pandas <strong>DataFrame</strong> with <strong>df.profile_report()</strong> for quick data analysis.We get a great visual handy report to see the dossier about our data set.</blockquote><figure><img alt="pandas_profiling Snippet" src="https://cdn-images-1.medium.com/max/517/1*u-TGujL5j-vpJarEG5lNCA.png" /><figcaption><strong>pandas_profiling Snippet</strong></figcaption></figure><p><strong>Explanation</strong>: Just for doing the analysis, we import the pandas_profiling and pandas lib, since we analyzing ‘loansdata.csv’ so reading this file and generating the analysis profile report which is in .html.</p><p><strong>Note</strong>: <strong>display() </strong>function, display the same output in the window instead to generate a file, it uses when we work with jupyter.</p><p>For large datasets, the analysis can run out of memory. In that case, it is useful to disable the correlation analysis as below:</p><blockquote>profile = pandas_profiling.ProfileReport(df, check_correlation = False)</blockquote><p>We have generated a profile summary report (“<strong>DataAnalysisProfile.html </strong>“) for a returned data set. Most things can capture in this report for EDA perspective or understanding about the data for further exploration.</p><p>In the Profile report:” We will have five-section (all are clickable in the report) as below explanation.</p><blockquote><strong>Overview:</strong> <strong>The overview section</strong> provides overall data set information. This section has 2 sub-sections namely <strong>‘Dataset info’</strong> and <strong>‘Variables types’</strong>.</blockquote><blockquote><strong>Datasets info</strong> sub-section displays several variables (columns), several observations (rows), missing cells, duplicate rows, total size, etc.</blockquote><blockquote><strong>Variables Types</strong> sub-section displays types of features like how many features are of numeric type, how many are of categorical type, boolean, date, URL, text (Unique), rejected, unsupported. Besides, it even displays <strong>‘Warnings’ </strong>where it gives which feature(s) are highly correlated to others and which have a maximum percentage of 0s.</blockquote><figure><img alt="pandas_profiling Overview" src="https://cdn-images-1.medium.com/max/1001/1*etEEG705HI99pU73_glv2A.png" /><figcaption><strong>pandas_profiling Overview</strong></figcaption></figure><blockquote><strong>Variables</strong>: <strong>Variables section</strong> provides the information of every feature individually unlike <strong>Overview sections</strong> which provides information on the whole data set. It provides information like unique points and its percentage; missing values and its percentage. Also, as we can see on the right side, it gives a minimum and maximum values, and the percentage of zeros in that feature.</blockquote><figure><img alt="pandas_profiling Variables" src="https://cdn-images-1.medium.com/max/820/1*sqs-hOKdHsmZMB0laFBNpw.png" /><figcaption><strong>pandas_profiling Variables</strong></figcaption></figure><p>If we click on the <strong>Toggle details </strong>option as shown in the above image, the new section shows up.</p><blockquote><strong>Correlations: Correlation section </strong>provides<strong> a </strong>visualization of how features are correlated to each other with seaborn’s heatmap. We can have a clear and easy understanding of how features are correlated with each other. Referring to the highlight in the above image (Correlation section), we can easily toggle between different correlations like <strong>Pearson, Spearman, Kendall</strong>, and <strong>phik.</strong></blockquote><figure><img alt="pandas_profiling Correlations" src="https://cdn-images-1.medium.com/max/860/1*OLRbfaAw5N55-bgiOkZwIA.png" /><figcaption><strong>pandas_profiling Correlations</strong></figcaption></figure><blockquote><strong>Missing Values: </strong>This section provides different graphs <strong>‘Matrix’, ‘Count’</strong>, <strong>Heatmap </strong>etc.</blockquote><blockquote>In the <strong>Matrix graph</strong>, we can visualize missing values. From the left graph, we can conclude that there are no missing values.</blockquote><blockquote>In the <strong>Count</strong> <strong>graph</strong>, we can visualize the count of data points in each feature. From the left graph, we can conclude that all the features have the same count of data points.</blockquote><figure><img alt="pandas_profiling Missing Values" src="https://cdn-images-1.medium.com/max/875/1*Z-eqORjyaf5HEwMLFpUsNw.png" /><figcaption><strong>pandas_profiling Missing Values</strong></figcaption></figure><blockquote><strong>Sample:</strong> This section displays 1st 10 data points (head of 10) and the bottom 10 data points (tail of 10).</blockquote><figure><img alt="pandas_profiling Sample First 10 Rows" src="https://cdn-images-1.medium.com/max/992/1*6M_noCyWSl7BfXkxihU0Mg.png" /><figcaption><strong>pandas_profiling Sample First 10 Rows</strong></figcaption></figure><figure><img alt="pandas_profiling Sample Last 10 Rows" src="https://cdn-images-1.medium.com/max/991/1*qSrk9fxO0REyxJGyAyYYCw.png" /><figcaption><strong>pandas_profiling Sample Last 10 Rows</strong></figcaption></figure><blockquote><strong>Keep in Mind:</strong></blockquote><blockquote>Applying all these conditions becomes a tedious task for EDA but using pandas profiling its apply within a second to give you a platter of data analysis, but remember it’s all applied by a set of rules — like plot <strong>boxplot </strong>and <strong>histogram </strong>for a continuous variable, Measures <strong>missing values</strong>, Calculate <strong>frequency </strong>if it’s a categorical variable — thus giving us opportunity to automate things. That’s the base of this python module <strong>pandas_profiling</strong> that helps us to automate the first-level of EDA of dataset.</blockquote><p><em>If you find it useful, do clap and share it among your enthusiastic peers.</em></p><h4><em>More to come! Stay tuned, and thanks for reading :)</em></h4><h4><em>Happy Learning !!</em></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19a4e1064d53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to choose your way to manage Tableau Server Deployment]]></title>
            <link>https://datageek-prabhakarpandey.medium.com/how-to-choose-your-way-to-manage-tableau-server-deployment-369331743cb7?source=rss-1f060b72acc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/369331743cb7</guid>
            <category><![CDATA[tableau-training]]></category>
            <category><![CDATA[business-intelligence]]></category>
            <category><![CDATA[tableau]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[tableau-server]]></category>
            <dc:creator><![CDATA[Prabhakar Pandey]]></dc:creator>
            <pubDate>Fri, 18 Sep 2020 11:32:59 GMT</pubDate>
            <atom:updated>2020-09-18T11:32:59.789Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>Tableau Reports Deployment Environment</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Da5XSMDzldDPRigm-D0-gw.gif" /><figcaption>Are you ready for Tableau Reports migration</figcaption></figure><p>Deploying and managing a Tableau Server involves a set of responsibilities that we can categories into two different roles — one role that owns or administers the content on the server (the content admin), and another that architects and maintains the server and underlying system (the system admin).</p><p>We can have UAT/Production. That’s fine, but we can also have a sandbox area where we can play around. Develop in Tableau Desktop, then publish to Tableau Server for testing and finally, promoting to production.</p><h3><strong>Environments</strong>?</h3><p>Common names for these environments are development, test/QA, staging/pre-production, and production. There are typically three to four environments (staging/pre-production is often omitted). These environments can exist as either separate projects or as sites on the same Tableau Server instance. Or each one might be a separate instance of Tableau Server.</p><h3><strong>QA/Dev Process:</strong></h3><p>The QA process is straightforward when we look at it from a high level. Below is a simplification of the workflow. Realistically we will have a back-and-forth between the QA analyst and developer as issues are found.</p><figure><img alt="Tableau Server Environment" src="https://cdn-images-1.medium.com/max/886/1*B0uDIjwhcf1qfBsro_OHkw.gif" /><figcaption>Tableau Server Environment</figcaption></figure><h3>Tableau Deployment Process Flow Diagram:</h3><figure><img alt="Tableau Server Deployment Process Flow" src="https://cdn-images-1.medium.com/max/936/1*ZSm44BbVQ7yUjuLrhNKkWA.gif" /><figcaption>Tableau Server Deployment Process Flow</figcaption></figure><h3><strong>Tableau Server-&gt;</strong></h3><p>We should have two virtual servers; one to be used for development and the other for both testing/production use.</p><h4><strong>Version Control: -</strong></h4><p>In Tableau Server we can manage version control with simple but uniform naming convention or use the landing area as a historical record of everything and only publish to a different Project/Site when the changes are ‘ready-to-deploy’.<br>We can add a sheet (dashboard) to each workbook called “changelog.” We can put the date, username, version number (assigned by us), and what changes were made. This has been very helpful as we develop dashboards. We, too, use “dev/QA” and “production” projects.</p><h4><strong>Tow Folders in PROD Env’s Site:</strong></h4><p><strong>Editor Workspace</strong>: We will create new folder in PROD for each site with name (<strong>Editor Workspace)</strong>, when we will deploy the report in PROD after Qa, and assign the report for UAT (User Accepting Testing).</p><p><strong>Version</strong>: We will create new folder in each site, we will place the old report in Version folder when we deploy the report in PROD’s final folder and replace old one.</p><h4><strong>How do I move all the things?</strong></h4><p>Once we’ve decided on a process to migrate the workbooks, the next step is to determine how we will be migrating them across the environments. Below we will outline the options that are available and then discuss how to choose the right one for migration.</p><h3>Migration options:</h3><p>There are a few different options for migrating the workbooks. There are trade-offs to each and we will discuss the pros and cons of each. Currently, the options available for migrating the workbooks and data sources are:</p><blockquote><strong>1- Tabcmd Script<br> 2- REST API<br> 3- TabMigrate<br> 4- Enterprise Deployment Tool (EDT) by InterWorks</strong></blockquote><p><strong>Check List for all the above option:</strong></p><figure><img alt="Check List" src="https://cdn-images-1.medium.com/max/825/1*XaAxH0VF--YAWyvDqdeF5Q.gif" /></figure><p><strong>Tabcmd</strong></p><blockquote>Tabcmd is the utility that comes with Tableau and allows us to interact with Tableau Server through a command line. By using tabcmd within a script, we can migrate our workbooks. We simply do a “tabcmd get” from the source and “tabcmd publish” to your destination.</blockquote><blockquote>Sounds easy enough, right? The challenge is that if We need to make any changes, like modifying data sources, we’ll have to programmatically manipulate the. twb XML (Tableau report), which is very error-prone.</blockquote><blockquote>Tabcmd also does not carry over permissions for the workbook and you must manually apply permissions to the new workbook.</blockquote><blockquote>Another limitation is that tabcmd’s publish will fail if there are two live data-source connections in the workbook.</blockquote><p><strong>Tableau REST API</strong></p><blockquote>An API is a programming interface and the REST simply denotes the way in which a programmer interacts with the API. Tableau’s API allows a programmer to interact with Tableau Server through various API calls. Like tabcmd, we may “get” and “publish” workbooks and data sources, but unlike tabcmd, we can also set permissions programmatically.</blockquote><blockquote>The largest drawback to using the REST API is that it we will have to develop the entire process code.</blockquote><p><strong>TabMigrate</strong></p><blockquote>TabMigrate is an open-source project released by Tableau and is a software utility created by Tableau developers to migrate workbooks and data sources. We can use TabMigrate as is, or, TabMigrate has a minimal UI that allows us to export all the workbooks and data sources from one server to a local folder then upload those files to another server. We can manually do transformations on the files once We have them in our local folder. There is some editing of XML and other files required to configure the migration.</blockquote><blockquote>TabMigrate makes it possible to do repeatable bulk migrations as well as limited transformations, like data source replacement. One limitation of TabMigrate is that it does not set permissions on migrated data sources.</blockquote><p><strong>Enterprise deployment tool (EDT)</strong></p><blockquote>Enterprise deployment tool (EDT) is a third-party software tool for doing workbook and data source migrations. EDT has a wizard-type interface that walks you through selecting workbooks, applying transformations, setting permissions, then deploying your workbooks and data sources. It also includes rollback functionality, letting your rollback an entire deployment if you use its archive workbook feature.</blockquote><blockquote>EDT allows you to save your migrations and rerun them later or execute them from a command line or via script.</blockquote><blockquote>EDT is the most full-featured option on this list, but it’s also the only one we must purchase, which is its biggest limitation.</blockquote><h4><strong>What’s the right decision? Decision is yours !!</strong></h4><p>The right decision is what works best for us. The first step we need to take is to understand our needs. Start by considering these questions.</p><blockquote>1-How many workbooks or data sources we are deploying? How much time is required?</blockquote><blockquote>2-Are we using separate projects, sites, or Tableau Servers as our environments?</blockquote><blockquote>3- Do we have separate data sources for each environment? For example, the test environment uses a separate database than the development environment.</blockquote><blockquote>4- Are any transformations being applied during the migration?</blockquote><p>The more complex your deployment scenario, the good option is to write the scripts process necessary to do the deployment. As your deployments get larger and more complex, it makes sense to begin looking at TabMigrate and EDT to see which one will best suit your needs.</p><blockquote><em>If you find it useful, do clap and share it among your enthusiastic peers.</em></blockquote><blockquote><em>More to come! Stay tuned, and thanks for reading :)</em></blockquote><blockquote><em>Happy Learning !!</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=369331743cb7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pythonic way of storing your data]]></title>
            <link>https://datageek-prabhakarpandey.medium.com/pythonic-way-of-storing-your-data-f9bd7a5f30f5?source=rss-1f060b72acc7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9bd7a5f30f5</guid>
            <category><![CDATA[python-dictionaries]]></category>
            <category><![CDATA[basic-python]]></category>
            <category><![CDATA[python-data-structures]]></category>
            <category><![CDATA[python-list]]></category>
            <category><![CDATA[python-beginner]]></category>
            <dc:creator><![CDATA[Prabhakar Pandey]]></dc:creator>
            <pubDate>Thu, 17 Sep 2020 16:23:45 GMT</pubDate>
            <atom:updated>2020-09-18T11:37:47.813Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python Data Structure-A <strong>Pythonic way of </strong>storing your data</h3><h4>List/Tuple/Dictionary/Set</h4><figure><img alt="Python Data Structure- List, Tuple, Dictonary. Set" src="https://cdn-images-1.medium.com/max/695/1*UKFeguTx-HqD-zEd6Av0sQ.gif" /></figure><blockquote>A Data Structure is a way of organizing the data in the system so that it can be used effectively. A Data Structure is a collection of Data Values, the relationship among them, and the function or operation that can be applied to the data.</blockquote><blockquote>Ex: We can store a list of items having the same data type using an array data structure.</blockquote><h3>Data Structure types:</h3><h4>Homogeneous:</h4><blockquote>When the type of the data is the same called Homogeneous Data Structure</blockquote><blockquote>o 1 dimensional &gt;&gt; array</blockquote><blockquote>o 2 dimensional</blockquote><blockquote>o Multidimensional</blockquote><h4>Heterogeneous:</h4><blockquote>When the type of the data is differently called Heterogeneous Data Structure</blockquote><blockquote>o 1 dimensional</blockquote><blockquote>o 2 dimensional &gt;&gt; table (The Table may have the different types of Data columns.)</blockquote><blockquote>o Multidimensional &gt;&gt; containers</blockquote><p><strong>Core Python’s Data Structure</strong>: Python provides only <strong>1-Dimensional Heterogeneous</strong> Data Structure.</p><p>which is four types:</p><blockquote>*Tuples</blockquote><blockquote>*List</blockquote><blockquote>*Dictionary</blockquote><blockquote>*Sets</blockquote><figure><img alt="Python Data Structure- List, Tuple, Dictonary, Set" src="https://cdn-images-1.medium.com/max/382/1*ylDH58PU6cpFsWi-o3jnbQ.gif" /></figure><h3>Tuples</h3><p>A tuple is a Python 1-D Heterogeneous Data Structure<br>tuple is created using round bracket () (parenthesis)</p><p>Ex- t1= (123,456,789) o/p: (123,456,789) type(t1)</p><p>o/p: Tuple<br>The output of the tuple also contained within the bracket<br><strong>Keep in Mind:</strong></p><blockquote>x=2 ##Every time the no of the element is one when we assign the value, If the no of elements is increased then the object call become the data structure<br>type(x) o/p=int<br>x=2,3 ## No of elements are increased so it’s a tuple Data Structure since this obj require a data structure to store the values or element ##Homogeneous Data Structure<br>type(x) o/p=tuple<br>x=123,’abc’,345 ##Heterogeneous Data Structure, doesn’t care if it is Homogeneous or Heterogeneous so can be int, char, string<br>type(x) o/p= tuple</blockquote><p><strong>How to Create Tuple:</strong></p><p>Tuple can be creating in Two ways-</p><p><strong>#Method1- Not advised</strong></p><p>t0=123,456,789</p><p>type(t0) o/p=tuple</p><p><strong>#Method2- Advised</strong></p><p>t1= (123,456,789)</p><p>type(t1) o/p=tuple</p><h3>List</h3><p>A List is a Python 1-D Heterogeneous Data Structure, List is created using square bracket []</p><p>Ex- l1=[123,456,789]</p><p>Oput: [123,456,789]</p><p>type(l1)</p><p>oput: List</p><p>The output of the List also contained within bracket</p><p>##Create a list</p><p>l1=[123,456,789]</p><p>type(l1) o/p=list</p><blockquote><strong>Why Python provides tuple and list data structure while the booth is looking same both are the 1d-heterogeneous data structure</strong></blockquote><p>t1=(123,456,678)</p><p>l1=[123,456,789]</p><p><strong>sub-setting or Extracting Elements from List/Tuple</strong>: The method of subsetting or accessing the value from List or Tuple are the same</p><p>l2 = [1,5,7,9,15,23,78,100]</p><p><strong>Extract 1st element</strong></p><p>l2[0] o/p=1</p><h4>Keep in Mind:</h4><blockquote>In python, the position number of the elements is called as the index.</blockquote><blockquote>The index starts from 0</blockquote><blockquote>Index number = Element Number — 1</blockquote><blockquote># e.g. l2 = [1,5,7,9,15,23,78,100]</blockquote><blockquote>Extract the 3rd element</blockquote><blockquote>index number = 3–1</blockquote><blockquote>index number =2</blockquote><blockquote>l1[2] output: 7</blockquote><blockquote>Note: For extracting the element we use object name and index no (position no) in bracket [] ie. l2[0]</blockquote><p>Extracting 1st to 6th element (1, 5, 7, 9, 15,23)</p><p>l2[0:5] # The upper bound is exclusive in python so the 6th element (23) will not consider</p><pre>o/p= [1, 5, 7, 9, 15]</pre><p>#for the 6 the element</p><p>l2[0:6]</p><pre>o/p= [1, 5, 7, 9, 15, 23]</pre><p>Extracting the value from 2nd index to all:</p><p>l2[2:]</p><pre>o/p= [7, 9, 15, 23, 78, 100]</pre><p>Extracting the value from the starting index to till 2nd index:(0 to 2nd index)<br>l2[:2] # Staring to 2nd index should be 1,5,7 but upper bound exclusively in python so the 2nd index(value 7) will not consider</p><pre>o/p=[1, 5]</pre><p>starting index to till 2nd index: (0 to 2nd index)</p><p>l2[:3]</p><pre>o/p=[1, 5, 7]</pre><pre>#Extract the value with step</pre><pre>l2[0:7:2]  # 0 to 7th index value with step 2 means here is upper bound exclusive (100 will not consider) and step with 2 value means 5,9,23 will not extract</pre><pre>o/p= [1, 7, 15, 78]</pre><p>Note: We create a tuple by use of () but we access the tuple by [] and we create &amp; access the list by []</p><p>We can’t access tuple like t1(0) it gives error not callable</p><h3><strong>List vs Tuple</strong></h3><p>Tuples are immutable means Tuples cannot be edit, List is mutable means List can be edit</p><p>Note: The assignment operator (=) used to save the value</p><pre>l2<br>[1, 5, 7, 9, 15, 23, 78, 100]<br>l2[1]*2   #1st index value multiplying by 3, We can edit the list (multiply by 3) and can save the value by assignment operator(=)</pre><p>Save the value in List</p><pre>l2[1]=l2[1]*3</pre><pre>l2</pre><pre>o/p=[1, 45, 7, 9, 15, 23, 78, 100]</pre><pre>t2 #Tuple<br>(1, 5, 7, 9, 15, 23, 78, 100)<br>t2[1]*3 #We can multiply but cant save the value since Tuple is immutable</pre><p>Save the value in Tuple<br>t2[1]=t2[1]*3 #1st index value multiplying by 3, We cant edit the Tuple since its immutable (multiply by 3) and cant save the value by assignment operator(=), Its give type error ‘ ‘tuple’ object does not support item assignment’</p><pre><strong>TypeError</strong>: &#39;tuple&#39; object does not support item assignment</pre><p>Note: We cant edit the Tuple Since Tuples are immutable, Once the Tuple always Tuple, We can do arithmetic operation on Tuple values but cant save.<br>We can edit the List Since List are mutable</p><p>Use Case: Why we have Tuple or List, <br>Store permanent values like DOB, Name we can use Tuple, Store temporary values like Age, A/C type we can use List.<br>Like OTP for mobile, no cant be edit and match with the server so we use Tuple for security purpose.</p><h3><strong>Dictionary</strong></h3><p>A Dictionary is a Python 1-D Heterogeneous Data Structure <br>Dictionary is created using square bracket {} with use of key &amp; value pairs<br>Syntax- dict1=[‘key’:value,’key’:value,’key’:value,] #Key is like the index(0,1,2..) and Values can be any object list, tuple, dictionary</p><p><strong>Ex:</strong> dict1 = {‘SName’: ‘Amit’, ‘SAge’: 30, ‘SCity’: ‘Blore’}</p><p>dict1</p><p>Oput: {‘SName’: ‘Amit’, ‘SAge’: 30, ‘SCity’: ‘Blore’}</p><p>type(dict1)</p><p>Oput: dict<br>The output of the List also contained within curly braces {}</p><p><strong>Keep in Mind:</strong></p><blockquote>Note: In tuple &amp; list we create an object we assign multiple elements to the object and we access the element by the index while Dictionary is different than list and tuple, In the dictionary, we use curly braces {} then we provide key and value.</blockquote><p>Ex: school_database={‘Name’:[‘Amit’,’Rohit’,’Pankaj’],’Score’:[20,32,24],’Location’:[‘Delhi’,’Bangalore’,’Noida’]}</p><pre>school_database<br>o/p= {&#39;Name&#39;: [&#39;Amit&#39;, &#39;Rohit&#39;, &#39;Pankaj&#39;],<br> &#39;Score&#39;: [20, 32, 24],<br> &#39;Location&#39;: [&#39;Delhi&#39;, &#39;Bangalore&#39;, &#39;Noida&#39;]}</pre><pre>##Dictionary attribute &#39;clear&#39;, &#39;copy&#39;, &#39;fromkeys&#39;, &#39;get&#39;, &#39;items&#39;, &#39;keys&#39;, &#39;pop&#39;, &#39;popitem&#39;, &#39;setdefault&#39;, &#39;update&#39;, &#39;values&#39;]<br>print(dir(school_database))</pre><p><strong>Extracting keys</strong></p><pre><strong>for</strong> i <strong>in</strong> school_database:  <em>##Getting only key<br>    </em>print(i)</pre><pre>o/p=<br>Name<br>Score<br>Location</pre><pre><strong>for</strong> i <strong>in</strong> school_database:  <em>##Getting only values, since dictanry have three list<br>    </em>print(school_database[i])</pre><pre>o/p=<br>[&#39;Amit&#39;, &#39;Rohit&#39;, &#39;Pankaj&#39;]<br>[20, 32, 24]<br>[&#39;Delhi&#39;, &#39;Bangalore&#39;, &#39;Noida&#39;]</pre><pre>Note: We can use values()&amp; keys() function to extract same</pre><blockquote><strong>Extract/Access the Dictionary Values:</strong><br>We cant access the Dictionary values like list and tuple for ex:school_database[0] its give the Error: KeyError: 0 since these are not index theses are the Keys so we need to pass the Key (name,score,location..etc are keys),</blockquote><p>for Ex: school_database[‘Name’]</p><p>oput-[‘Amit’, ‘Rohit’, ‘Pankaj’]</p><p>school_database[0] #Error:KeyError: 0 since dictionary doesn&#39;t have the index</p><pre>school_database[&#39;Name&#39;]<br>school_database[&#39;Score&#39;]<br>school_database[&#39;Location&#39;]<br>o/p=<br>[&#39;Delhi&#39;, &#39;Bangalore&#39;, &#39;Noida&#39;]</pre><p>Use Case: Dictionary is generally used to create the Table(Data Frame) Since the Table has row and column as in format.<br>First Create the dictionary then pass a dictionary to the data frame, Keys become the column name and rows become the row values.</p><pre><em>#Use the Dictionary in Table/Data frame<br></em><strong>import</strong> pandas <strong>as</strong> pd<br>pd.DataFrame(school_database)</pre><pre>o/p=<br>Name   Score Location<br>Amit    20   Delhi<br>Rohit   32   Bangalore<br>Pankaj  24  Noida</pre><h3><strong>Sets</strong></h3><p>A Sets are a Python 1-D Heterogeneous Data Structure, In Python Sets is a group of Distinct ordered elements.<br>Sets is created using round bracket curly braces {}</p><pre>Ex- set1 = {1,2,1,1,2,4,5,4,4,8,7,9,3,1,9,6,5,9,9,7,1,4,2,1,5}</pre><pre>set1<br>o/p=<br>{1, 2, 3, 4, 5, 6, 7, 8, 9} </pre><pre>type(set1)<br>o/p=<br>set</pre><p>The output of set automatically in ordered with distinct values.<br>Use case of Set: Whenever we need to pic only distinct sorted values from a set of values then we use set.</p><pre>set1 <strong>=</strong> {1,2,1,1,2,4,5,4,4,8,7,9,3,1,9,6,5,9,9,7,1,4,2,1,5}<br>set1   <em>#Distinct sorted values<br>o/p=<br></em>{1, 2, 3, 4, 5, 6, 7, 8, 9}</pre><blockquote><strong>Keep in Mind:</strong></blockquote><blockquote>We should not assign the value in predefined keyword (list,set) like set={1,2,3,1}, The set is predefined keyword or function we should not overwrite it otherwise we will not able to use it to further.<br>For Ex: We have a list l1 and we want to convert this list into a set but suppose we have already overwritten the predefined set variable(set={1,2,3}) in our above code then we cant use(convert) it until we release that set keyword using (del set) or we get the error ‘set’ object is not callable’.</blockquote><p>delete a predefined object<br>del set</p><p>Use case: Convert list into set, Suppose we have list of salaries we want to show the distinct salary out of the list to check threshold of salary</p><pre>l1 =[1, 2, 3, 2, 1]<br>s1 = set(l1) #Convert list into set by set() function<br>s1<br>{1, 2, 3}</pre><blockquote>If you find it useful, do clap and share it among your enthusiastic peers</blockquote><blockquote><strong>More</strong> to come! <strong>Stay tuned</strong>, and <strong>thanks for reading</strong> :)</blockquote><blockquote>Happy Learning !!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9bd7a5f30f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>