<?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 Dipika Parbatsinh Pawar on Medium]]></title>
        <description><![CDATA[Stories by Dipika Parbatsinh Pawar on Medium]]></description>
        <link>https://medium.com/@dipikaparbatsinhpawar?source=rss-b2102bc32e63------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*G-ABhY2sgxo2t7oI</url>
            <title>Stories by Dipika Parbatsinh Pawar on Medium</title>
            <link>https://medium.com/@dipikaparbatsinhpawar?source=rss-b2102bc32e63------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 04:50:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dipikaparbatsinhpawar/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[Person’s Income Prediction and Analysis using Python]]></title>
            <link>https://medium.com/clique-org/persons-income-prediction-and-analysis-using-python-97f939d19694?source=rss-b2102bc32e63------2</link>
            <guid isPermaLink="false">https://medium.com/p/97f939d19694</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[income-prediction]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[confusion-matrix]]></category>
            <category><![CDATA[machine-learning-models]]></category>
            <dc:creator><![CDATA[Dipika Parbatsinh Pawar]]></dc:creator>
            <pubDate>Sat, 16 Jan 2021 11:41:46 GMT</pubDate>
            <atom:updated>2021-01-18T05:27:39.098Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*VK1P0hRUybzuBUBm852pfA.png" /><figcaption><strong>[Fig: 1] </strong>Image Source: <a href="https://justcreative.com/2019/07/16/passive-income-ideas/">https://justcreative.com/2019/07/16/passive-income-ideas/</a></figcaption></figure><h3><strong>Introduction:</strong></h3><p>Predictive Analysis is used to identify respective trends and behaviors, such that we can make decision for some unknown event. Apart from Data Analysis, Predictive Analysis is a combination of <strong>data collection, pattern analysis, predictive modeling </strong>and <strong>analysis of prediction </strong>as well. Coming back to the topic: at the end, we all want is money. To analyse what are the best combination of <strong>age, education, marital-status</strong>, etc. for person’s Income and for some business purpose Income prediction is so much important. Now we understood the importance of the Person’s Income prediction then here are few steps through which we can achieve the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwVstNnkjSwbc27w5W1KBw.png" /><figcaption><strong>[Fig: 2]</strong> <strong>The 8 steps of the pipeline of Predictive analysis</strong></figcaption></figure><h3><strong>Step 1: Data collection</strong></h3><p>In the first step, there are two option for the selection of any dataset.</p><p>i) We already have any problem statement and want to find the data for same</p><p>ii) We have any dataset and want to retrieve information from it</p><p>Here we have an <a href="https://www.kaggle.com/uciml/adult-census-income">person’s income prediction</a> dataset. This dataset has 48842 rows × 15 columns</p><pre>#read data from drive folder<br>data = pd.read_csv(&#39;Drive/My Drive/adult.csv&#39;)<br>data<br>data.dtypes</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QBlycKmzipVQtwu4daDyrg.png" /><figcaption><strong>[Fig: 3]</strong> <strong>Overview of</strong> <strong>the Dataset</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*mOi1g1d5NKymxyaSlgrgwQ.png" /><figcaption><strong>[Fig: 4] Datatype of Each Column</strong></figcaption></figure><ul><li>Some columns Explanation: Workclass can be categorized as Private, Local-gov, etc.</li><li>fnlwgt represents final weight</li><li>education is the highest education that one had gain</li><li>Target column Income which categorized as Income &gt;50K/≤50K</li></ul><h3><strong>Step 2: The Usecase</strong></h3><ul><li>The most important step of Data Analysis is forming<strong> Usecases/Research question</strong>. These questions varying person by person and use cases may also be different which will lead to respective answer by analysis.</li><li>Good Usecases may lead to better Consumer experience and also help business to analysis consumer’s buying habits, sales patterns , etc.</li><li>After forming those question, just sort them according to importance and pick relevant ones.</li></ul><p>i) Prediction of “Income” based on best correlated features from age, work-class, education, marital-status, gender, etc. features.</p><p>ii) Relation between Education and Income</p><p>iii) Age wise marital status and many more usecases can be formed.</p><h3>Step 3: Data Cleaning</h3><ul><li>To work on our usecases, it is important to clean data, because it improves data quality and leads to the better results of prediction.</li><li>We can clean the data by removing <strong>the missing or Null data, columns/rows which contain only null entries, redundant columns/ rows, those columns which have only one unique value</strong>, etc.</li><li>Here we have null entries in form of “?”. Also here education_num is encoded version of education column. So this is unnecessary repetition.</li></ul><pre>for col in data.columns:<br>   indexNames = data[ data[col] == &quot;?&quot; ].index<br>   # Delete these row indexes from dataFrame<br>   data.drop(indexNames , inplace=True)<br>   data)</pre><pre># remove column<br>data=data.drop(&quot;educational-num&quot;,axis=1)</pre><p>To find most relevant features, here is the table which represents the correlation score for respective column with target column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*qQyXu-O-yVTpfF1jZ5GLsg.png" /><figcaption><strong>[Fig: 5] Correlation Table in Descending order of absolute correlation</strong></figcaption></figure><h3><strong>Step 4: Data Analysis</strong></h3><ul><li>We already created Usecases and now we have cleaned data as well. So based on that, these are the few analysis for our usecases.</li><li>Analysis can be in terms of text, table, graph, etc.</li><li>Different type of visualization represent data well based on combination of attribute type (numerical, categorical)</li></ul><p><strong>Education</strong> is Categorical type variable. To display its distribution <strong>bar chart</strong> is the best choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*pINqP7PzdctNn7ediEODcw.png" /><figcaption><strong>[Fig: 6] Distribution of Education wrt Income</strong></figcaption></figure><ul><li>The education of person plays the most important role in his/her Income. (From the correlation table [Fig: 5])</li><li>This graph shows how many number of records are &gt;50K/≤50K for specific Higher education.</li><li>As we can see that people who have Bachelors as a highest degree, have higher count in &gt;50K income</li></ul><p><strong>Workclass</strong> is categorical type variable and to analyse its proportional distribution in whole dataset <strong>Pie chart</strong> is the best choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*9_BQVyqCyLKJQIqEKyHlrQ.png" /><figcaption><strong>[Fig: 7] Portion distribution of workclass</strong></figcaption></figure><ul><li>This pie-chart shows the portion of particular workclass in the whole data</li><li>It basically gives insights of work distribution in income prediction dataset. Like 73.7% people are in private sector, etc.</li></ul><p><strong>Age</strong> is numeric type and marital-status is categorical type. For relation of numeric and categorical feature distribution kind of plots are used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/0*CM4tqx6NFf0ssMF8" /><figcaption><strong>[Fig: 8] Age wise marital status Usecase</strong></figcaption></figure><ul><li>To understand the relation of marital-status with different age groups, here is a plot.</li><li>This <strong>Violin plot </strong>shows density of any marital-status with respect to Age.</li><li>As never-married group have the most density between the age range of 20–30.</li></ul><h3><strong>Step 5: Data Preprocessing(Preparation)</strong></h3><ul><li>For training the model to get better results, we need to first preprocess the data.</li><li>In which encode the categorical attributes to make them numerical type, Normalization of numerical attributes, best related feature selection<strong> </strong>can be done.</li></ul><h4>Normalization</h4><p>The main purpose is to scale the numerical value from all the columns to same scale.</p><pre><strong>from</strong> <strong>sklearn.preprocessing</strong> <strong>import</strong> MinMaxScaler<br>scaler = MinMaxScaler()<br>numerical = [&#39;age&#39;,&#39;capital-gain&#39;,&#39;capital-loss&#39;,&#39;hours-per-week&#39;]<br><br><strong>for</strong> i <strong>in</strong> numerical:<br>  data[i]-=data[i].min()<br>  data[i] /= data[i].max()</pre><h4>Encoding:</h4><p>Encoding converts categorical variable into baskets from 0 to n(total number of categories). The importance is the numeric values are easy to be process and most of ML models need numeric input/output.</p><pre>features_final = pd.get_dummies(data)<br><strong>for</strong> col <strong>in</strong> data.columns:<br>  <strong>if</strong> col <strong>not</strong> <strong>in</strong> numerical:<br>    temp={}<br>    <strong>for</strong> i <strong>in</strong> range(len(data[col].unique())):<br>      temp[data[col].unique()[i]]=i<br>    work = data[col].map(temp)<br>    data[col]=work<br><br>encoded = list(data.columns)<br>print(&quot;<strong>{}</strong> total features after one-hot encoding&quot;.format(len(encoded)))<br>encoded</pre><h3><strong>Step 6: Model Training</strong></h3><ul><li>Now we are ready to train a model. Here Income, our target column is categorical type. So the <strong>classification algorithm</strong>s will be used because we want categorized output in some category.</li><li>After trying implementation of few classification algorithm like SVM, Regression, Naive Bayes, Random Forest, etc. in scikit-learn, here are some results in terms of accuracy.</li><li>For these models, input are the selected most correlated features and output is to predict income(≥50K / &lt;50K).</li></ul><h4>Split the dataset in 70–30%</h4><pre><strong>from</strong> <strong>imblearn.over_sampling</strong> <strong>import</strong> SMOTE<br><br>x_train, x_test, y_train, y_test = train_test_split(features_final, income, test_size=0.30, random_state=1)<br>X_train, Y_train = SMOTE().fit_sample(x_train, y_train)</pre><h4>Decision Tree Algorithm</h4><pre><strong>from</strong> <strong>sklearn</strong> <strong>import</strong> tree<br>dt =tree.DecisionTreeClassifier(criterion=&#39;entropy&#39;,<br>    min_samples_split=8,max_depth=10)<br>dt = dt.fit(X_train, Y_train)<br>y_pred_dt = dt.predict(x_test)<br>y_train_score_dt = dt.predict(X_train)<br>print(accuracy_score(y_test, y_pred_dt, normalize=<strong>False</strong>, sample_weight=<strong>None</strong>)*100/len(y_test))<br>print(accuracy_score(Y_train, y_train_score_dt, normalize=<strong>False</strong>, sample_weight=<strong>None</strong>)*100/len(Y_train))</pre><h4>Random Forest Algorithm</h4><pre>rf=RandomForestClassifier(min_samples_split=20)<br>rf.fit(X_train, Y_train)<br>y_pred = rf.predict(x_test)<br>y_test_pred = rf.predict(X_train)<br>print(accuracy_score(y_test, y_pred, normalize=<strong>False</strong>, sample_weight=<strong>None</strong>)*100/len(y_test))<br>print(accuracy_score(Y_train, y_test_pred, normalize=<strong>False</strong>, sample_weight=<strong>None</strong>)*100/len(Y_train))</pre><h3><strong>Step 7: </strong>Performance Evaluation</h3><p>After the implementation of those 5 algorithms, Random forest performs best. The best model is not based on the accuracy result but also on precision, recall , True positive/negative(classification report), etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*27U_JUdPE4ZNFHjhDpMj4A.png" /><figcaption><strong>[Fig: 9] 1–0 as income ≥50K and &lt;50K</strong></figcaption></figure><ul><li>This is Confusion matrix for Random Forest Implementation</li><li>Total length of test dataset is 13567, out of which 8687 records are classified as TP ans so on.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*tOyai-C4ndFwdWHOxkSgjg.png" /><figcaption><strong>[Fig: 10] Classification Report</strong></figcaption></figure><h3>Step 8: Final predict analysis</h3><ul><li>Here is the final outcome in form of comparison for real and predictive income gender wise.</li><li>Where income =0 means &lt;50K and 1 means ≥50K</li><li>From the below graphs, the misleading behavior in Male is more than in female for Income prediction.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8qnbih8B7ixYcnzi" /><figcaption><strong>[Fig: 11] Comparison of predicted and real income gender wise</strong></figcaption></figure><h3>Conclusion:</h3><p>According to correlation table, only some of the features are directly related in Income prediction. The selection of those column play an important role for model accuracy. Also here Random Forest suits best on this dataset. Misleading prediction rate in Male is more than in Female. The dataset need not always be clean or small. So we have to define a way , a method which we can generalize on each and every kind of dataset. Here the workflow explained step by step which you can correlate with your respective dataset. Also the Different type of visualization represent data well based on combination of attribute type (numerical, categorical) and the selection of classification algorithm completely based on dataset.</p><h4>Full code can be found <a href="https://colab.research.google.com/drive/1BGENrO0emtqo0ci6M72p1nKcHwonWUGy?usp=sharing">here</a>. The implementation is exclusively using Python language.</h4><h3><strong>References:</strong></h3><p>[1] <a href="https://arxiv.org/ftp/arxiv/papers/1810/1810.10076.pdf">N. Chakrabarty and S. Biswas, “A Statistical Approach to Adult Census Income Level Prediction,” 2018 International Conference on Advances in Computing, Communication Control and Networking (ICACCCN), Greater Noida (UP), India, 2018, pp. 207–212, doi: 10.1109/ICACCCN.2018.8748528</a></p><p>[2] <a href="https://www.ahajournals.org/doi/full/10.1161/01.STR.31.4.869">https://www.ahajournals.org/doi/full/10.1161/01.STR.31.4.869</a></p><p>[3]h<a href="https://seaborn.pydata.org/introduction.html#:~:text=Seaborn%20is%20a%20library%20for,explore%20and%20understand%20your%20data">ttps://seaborn.pydata.org/introduction.html#:~:text=Seaborn%20is%20a%20library%20for,explore%20and%20understand%20your%20data</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97f939d19694" width="1" height="1" alt=""><hr><p><a href="https://medium.com/clique-org/persons-income-prediction-and-analysis-using-python-97f939d19694">Person’s Income Prediction and Analysis using Python</a> was originally published in <a href="https://medium.com/clique-org">Clique Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Management and Visualization — Week 4]]></title>
            <link>https://dipikaparbatsinhpawar.medium.com/data-management-and-visualization-week-4-89bf11adbcd6?source=rss-b2102bc32e63------2</link>
            <guid isPermaLink="false">https://medium.com/p/89bf11adbcd6</guid>
            <dc:creator><![CDATA[Dipika Parbatsinh Pawar]]></dc:creator>
            <pubDate>Sun, 06 Sep 2020 07:08:40 GMT</pubDate>
            <atom:updated>2020-09-06T07:08:40.416Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://medium.com/@dipikaparbatsinhpawar/data-management-and-visualization-week-2-a7e25dc28d93?source=your_stories_page---------------------------">Data Management and Visualization — Week </a>4</h3><p>My name is Dipika Pawar and this blog is a part of<a href="https://www.coursera.org/learn/data-visualization/home/welcome"> Data Management and Visualization</a> course on coursera. The submission of the assignments will be in the form of blogs. So I choose medium as my medium of assignment. Click here for previous reference <a href="https://medium.com/@dipikaparbatsinhpawar/data-management-and-visualization-week-1-a24d7382eb1b">Week1</a> ,<a href="https://medium.com/@dipikaparbatsinhpawar/data-management-and-visualization-week-2-a7e25dc28d93">Week2</a>, <a href="https://medium.com/@dipikaparbatsinhpawar/data-management-and-visualization-week-3-cb5c6e19b07f">Week3</a>.</p><p><strong>Here is my codebook:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/0*e1-63eVgUPtvmUu0.png" /></figure><p><strong>Research Question:</strong></p><blockquote><em>Is there any relation between life expectancy and alcohol consumption?</em></blockquote><blockquote><em>Is there any relation between Income and alcohol consumption?</em></blockquote><p><strong>Assignment 4:</strong></p><p>In this assignment, we have to represent our variables in visual form like graphs. In this case all of the variables(Income, Alcohol &amp; Life) are quantitative variables. Therefore I firstly plot each univariants and then plot the scatter plot(Q → Q) for bivariant graph for each research question. After that I divided them into category (concert quantitative to categorical). Then again univariant graph of all and bar chart(c →c) for bivariant graph.</p><p><strong>Step 1: Univariant graphs of all the variables (Quantitative)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*M4OEV7k8c7Eh-uQmH9wXwg.png" /><figcaption>2008 alcohol consumption per adult (liters, age 15+)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*RJontHWHrtF6h5-LjVHOoQ.png" /><figcaption>2010 Gross Domestic Product per capita in constant 2000 US$</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*i9hnYyG1uPPJwX_9VmEC2A.png" /><figcaption>2011 life expectancy at birth (years)</figcaption></figure><p><strong>Step 2: Bivariant graph for each research question (Quantitative → Quantitative)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OqkCMn4lWhtzpSSj0GWICw.png" /><figcaption>Scatterplot for the Association Between Alcohol Consumption and Income per person</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8UvYVgwfImeRexAJPuhkGg.png" /><figcaption>Scatterplot for the Association Between Alcohol Consumption and Life Expectnacy</figcaption></figure><p><strong>Step 3: Conversation from quantitative to categorical</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Lq7bKZoQq1qUiUdm5_fCg.png" /></figure><p><strong>Step 4: Univariant graphs of all the variables (Categorical)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*MpuAoBbAlTDup4HuCgZT5g.png" /><figcaption>2010 Gross Domestic Product per capita in constant 2000 US$</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T2UxMQfJ6eoct8ih4cS76Q.png" /><figcaption>2008 alcohol consumption per adult (liters, age 15+)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*DJFi7WelHZ0KzChmu7Q5fQ.png" /><figcaption>2011 life expectancy at birth (years)</figcaption></figure><p><strong>Step 5: Bivariant graph for each research question (Categorical → Categorical)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*HMqrKcefeSKUTKmmeoQpcw.png" /><figcaption>Bart Chart for the Association Between Alcohol Consumption and LIfe Expectancy</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*klhJLXO2UyaaPlM7DEg6rQ.png" /><figcaption>Bart Chart for the Association Between Alcohol Consumption and Income per person</figcaption></figure><p><strong>Conclusion:</strong></p><blockquote>From the scatter plot , it seems like these variables are not correlated but from the bar chart we can say that ,</blockquote><blockquote>If Income is less, Alcohol consumption is less</blockquote><blockquote>we can say that moderate alcohol consumption can contribute to life expectancy increases. Of course, this not a scientific work and have value only for this context.</blockquote><p>Entire code can be found from<a href="https://github.com/DipikaPawar12/Data-Management-and-Visualization/tree/master/Week4"> here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89bf11adbcd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Management and Visualization — Week 3]]></title>
            <link>https://dipikaparbatsinhpawar.medium.com/data-management-and-visualization-week-3-cb5c6e19b07f?source=rss-b2102bc32e63------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb5c6e19b07f</guid>
            <dc:creator><![CDATA[Dipika Parbatsinh Pawar]]></dc:creator>
            <pubDate>Wed, 02 Sep 2020 17:44:24 GMT</pubDate>
            <atom:updated>2020-09-02T17:46:39.002Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://medium.com/@dipikaparbatsinhpawar/data-management-and-visualization-week-2-a7e25dc28d93?source=your_stories_page---------------------------">Data Management and Visualization — Week </a>3</h3><p>My name is Dipika Pawar and this blog is a part of<a href="https://www.coursera.org/learn/data-visualization/home/welcome"> Data Management and Visualization</a> course on coursera. The submission of the assignments will be in the form of blogs. So I choose medium as my medium of assignment. Click here for previous reference <a href="https://medium.com/@dipikaparbatsinhpawar/data-management-and-visualization-week-1-a24d7382eb1b">Week1</a> &amp; <a href="https://medium.com/@dipikaparbatsinhpawar/data-management-and-visualization-week-2-a7e25dc28d93">Week2</a>.</p><p><strong>Here is my codebook:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*95RAJ6FcjkCypPQXVwro8Q.png" /></figure><p><strong>Research Question:</strong></p><blockquote>Is there any relation between life expectancy and alcohol consumption?</blockquote><blockquote>Is there any relation between Income and alcohol consumption?</blockquote><p><strong>Assignment 3:</strong></p><p>Assignment 3 contains data management for respective topics. We have to make and implement decisions about data management for the variables. Data Management is a process to store, organize and maintaining the data. Security of data is very important to secure the data which is a part of Data Management.</p><p><strong>After the video of this week, here are the steps:</strong></p><blockquote>Setting aside missing data → Coding and validate the data → Creating secondary variables → Grouping values within individual variable</blockquote><p><strong>Blog contains:</strong></p><blockquote>Removing missing data rows</blockquote><blockquote>Make group of income, alcohol consumption and life expectancy</blockquote><blockquote>Show frequency distribution before and after grouping</blockquote><p><strong>Data Dictionary:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*W_IioOUNJBrnKoNeiveueA.png" /></figure><p><strong>Code:</strong></p><p><strong>Step 1</strong>: Importing Libraries</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EsnPAVYePvklZaslN5PuiA.png" /></figure><p><strong>Step 2:</strong> Read the specific columns of the dataset and rename the columns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T8w3lr6NIe6DftMnbbCQXA.png" /></figure><p><strong>Output</strong>: What data variable contains</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*rGC9xg7yaV3KYjTCD__kIg.png" /></figure><p>Step 3: convert arguments to a numeric types from .csv files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*rt54ZXlBn13FuEbpHYkFbg.png" /></figure><p><strong>Step 4: Drop the missing data rows</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*9ofGsW7mNpztBTH6DssoLA.png" /></figure><p><strong>Step 5:</strong> Display absolute and relative frequency</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QdrgRfLQwrkJ3bJqT5HXug.png" /></figure><p><strong>Output:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*agCHp3Qv2DaRB5s5mojKZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_axmFQ1a3eRsYcEJtTczg.png" /></figure><p><strong>Step 6: </strong>Make groups in variables to understand such research question</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ff_7lRGZ7MGcnB0bqeqnRg.png" /></figure><p><strong>Output:</strong> Change each variable’s values according to group numbers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kn8bIsKz9Zp14EaGirJiow.png" /></figure><p><strong>Step 7:</strong> Frequency Distribution of new grouped data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PBVq22FGuHTYdSBZSKqnmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pegEIPt-R-U2IpmT_wpeg.png" /></figure><p>=======================================</p><p><strong>Whole code:</strong></p><blockquote>#Import the libraries</blockquote><blockquote>import pandas</blockquote><blockquote>import numpy</blockquote><blockquote>from collections import OrderedDict</blockquote><blockquote>from tabulate import tabulate, tabulate_formats</blockquote><blockquote>data = pandas.read_csv(‘CodebookGap.csv’, low_memory=False,</blockquote><blockquote>skip_blank_lines=True, usecols=[‘country’,’incomeperperson’, ‘alcconsumption’, ‘lifeexpectancy’])</blockquote><blockquote>data.columns=[‘country’, ‘income’, ‘alcohol’, ‘life’]</blockquote><blockquote>‘’’</blockquote><blockquote># Variables Descriptions</blockquote><blockquote>alcohol = “2008 alcohol consumption per adult (liters, age 15+)”</blockquote><blockquote>income = “2010 Gross Domestic Product per capita in constant 2000 US$”</blockquote><blockquote>life = “2011 life expectancy at birth (years)”’’’</blockquote><blockquote>data.info()</blockquote><blockquote>for dt in (‘income’,’alcohol’,’life’) :</blockquote><blockquote>data[dt] = pandas.to_numeric(data[dt], errors=’coerce’)</blockquote><blockquote>data.info()</blockquote><blockquote>nullLabels =data[data.country.isnull() | data.income.isnull() | data.alcohol.isnull() | data.life.isnull()]</blockquote><blockquote>print(nullLabels)</blockquote><blockquote>data = data.dropna(axis=0, how=’any’)</blockquote><blockquote>print (data.info())</blockquote><blockquote>c2 = data[‘income’].value_counts(sort=False)</blockquote><blockquote>p2 = data[‘income’].value_counts(sort=False, normalize=True)</blockquote><blockquote>c3 = data[‘alcohol’].value_counts(sort=False)</blockquote><blockquote>p3 = data[‘alcohol’].value_counts(sort=False, normalize=True)</blockquote><blockquote>c4 = data[‘life’].value_counts(sort=False)</blockquote><blockquote>p4 = data[‘life’].value_counts(sort=False, normalize=True)</blockquote><blockquote>print(“****************************************************”)</blockquote><blockquote>print(“*************Absolute Frequency********************”)</blockquote><blockquote>print(“Income Per Person:”)</blockquote><blockquote>print(“Income Freq”)</blockquote><blockquote>print(c2)</blockquote><blockquote>print(“Alcohol Consumption:”)</blockquote><blockquote>print(“Alcohol Freq”)</blockquote><blockquote>print(c3)</blockquote><blockquote>print(“Life Expecectancy:”)</blockquote><blockquote>print(“Life Freq”)</blockquote><blockquote>print(c4)</blockquote><blockquote>print(“****************************************************”)</blockquote><blockquote>print(“*************Relative Frequency********************”)</blockquote><blockquote>print(“Income Per Person:”)</blockquote><blockquote>print(“Income Freq”)</blockquote><blockquote>print(p2)</blockquote><blockquote>print(“Alcohol Consumption:”)</blockquote><blockquote>print(“Alcohol Freq”)</blockquote><blockquote>print(p3)</blockquote><blockquote>print(“Life Expecectancy:”)</blockquote><blockquote>print(“Life Freq”)</blockquote><blockquote>print(p4)</blockquote><blockquote>minMax = OrderedDict()</blockquote><blockquote>dict1 = OrderedDict()</blockquote><blockquote>dict1[‘min’] = data.life.min()</blockquote><blockquote>dict1[‘max’] = data.life.max()</blockquote><blockquote>minMax[‘life’] = dict1</blockquote><blockquote>dict2 = OrderedDict()</blockquote><blockquote>dict2[‘min’] = data.income.min()</blockquote><blockquote>dict2[‘max’] = data.income.max()</blockquote><blockquote>minMax[‘income’] = dict2</blockquote><blockquote>dict3 = OrderedDict()</blockquote><blockquote>dict3[‘min’] = data.alcohol.min()</blockquote><blockquote>dict3[‘max’] = data.alcohol.max()</blockquote><blockquote>minMax[‘alcohol’] = dict3</blockquote><blockquote>df = pandas.DataFrame([minMax[‘income’],minMax[‘life’],minMax[‘alcohol’]], index = [‘Income’,’Life’,’Alcohol’])</blockquote><blockquote>print (df.sort_index(axis=1, ascending=False))</blockquote><blockquote>dummyData = data.copy()</blockquote><blockquote># Maps</blockquote><blockquote>income_map = {1: ‘&gt;=100 &lt;5k’, 2: ‘&gt;=5k &lt;10k’, 3: ‘&gt;=10k &lt;20k’,</blockquote><blockquote>4: ‘&gt;=20K &lt; 30K’, 5: ‘&gt;=30K &lt;40K’, 6: ‘&gt;=40K &lt;50K’ }</blockquote><blockquote>life_map = {1: ‘&gt;=40 &lt;50’, 2: ‘&gt;=50 &lt;60’, 3: ‘&gt;=60 &lt;70’, 4: ‘&gt;=70 &lt;80’, 5: ‘&gt;=80 &lt;90’}</blockquote><blockquote>alcohol_map = {1: ‘&gt;=0.5 &lt;5’, 2: ‘&gt;=5 &lt;10’, 3: ‘&gt;=10 &lt;15’, 4: ‘&gt;=15 &lt;20’, 5: ‘&gt;=20 &lt;25’}</blockquote><blockquote>dummyData[‘income’] = pandas.cut(data.income,[100,5000,10000,20000,30000,40000,50000], labels=[‘1’,’2&#39;,’3&#39;,’4&#39;,’5&#39;,’6&#39;])</blockquote><blockquote>print(dummyData.head(10))</blockquote><blockquote>dummyData[‘life’] = pandas.cut(data.life,[40,50,60,70,80,90], labels=[‘1’,’2&#39;,’3&#39;,’4&#39;,’5&#39;])</blockquote><blockquote>print(dummyData.head(10))</blockquote><blockquote>dummyData[‘alcohol’] = pandas.cut(data.alcohol,[0.5,5,10,15,20,25], labels=[‘1’,’2&#39;,’3&#39;,’4&#39;,’5&#39;])</blockquote><blockquote>print (dummyData.head(10))</blockquote><blockquote>c2 = dummyData[‘income’].value_counts(sort=False)</blockquote><blockquote>p2 = dummyData[‘income’].value_counts(sort=False, normalize=True)</blockquote><blockquote>c3 = dummyData[‘alcohol’].value_counts(sort=False)</blockquote><blockquote>p3 = dummyData[‘alcohol’].value_counts(sort=False, normalize=True)</blockquote><blockquote>c4 = dummyData[‘life’].value_counts(sort=False)</blockquote><blockquote>p4 = dummyData[‘life’].value_counts(sort=False, normalize=True)</blockquote><blockquote>print(“****************************************************”)</blockquote><blockquote>print(“*************Absolute Frequency********************”)</blockquote><blockquote>print(“Income Per Person:”)</blockquote><blockquote>print(“Income-Freq”)</blockquote><blockquote>print(c2)</blockquote><blockquote>print(“Alcohol Consumption:”)</blockquote><blockquote>print(“Alcohol-Freq”)</blockquote><blockquote>print(c3)</blockquote><blockquote>print(“Life Expecectancy:”)</blockquote><blockquote>print(“Life-Freq”)</blockquote><blockquote>print(c4)</blockquote><blockquote>print(“****************************************************”)</blockquote><blockquote>print(“*************Relative Frequency********************”)</blockquote><blockquote>print(“Income Per Person:”)</blockquote><blockquote>print(“Income- Freq”)</blockquote><blockquote>print(p2)</blockquote><blockquote>print(“Alcohol Consumption:”)</blockquote><blockquote>print(“Alcohol-Freq”)</blockquote><blockquote>print(p3)</blockquote><blockquote>print(“Life Expecectancy:”)</blockquote><blockquote>print(“Life-Freq”)</blockquote><blockquote>print(p4)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb5c6e19b07f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Management and Visualization — Week 2]]></title>
            <link>https://dipikaparbatsinhpawar.medium.com/data-management-and-visualization-week-2-a7e25dc28d93?source=rss-b2102bc32e63------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7e25dc28d93</guid>
            <dc:creator><![CDATA[Dipika Parbatsinh Pawar]]></dc:creator>
            <pubDate>Mon, 24 Aug 2020 14:24:53 GMT</pubDate>
            <atom:updated>2020-08-24T14:24:53.895Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Management and Visualization — Week 2</h3><p>My name is Dipika Pawar and this blog is a part of<a href="https://www.coursera.org/learn/data-visualization/home/welcome"> Data Management and Visualization</a> course on coursera. The submission of the assignments will be in the form of blogs. So I choose medium as my medium of assignment. Click here for <a href="https://medium.com/@dipikaparbatsinhpawar/data-management-and-visualization-week-1-a24d7382eb1b">blog 1</a></p><p><strong>Assignment 2:</strong></p><p>In assignment 2, we have to first choose the framework for coding like python/SaS. So choose python for coding. Then we have to write code through which we can load the dataset in the memory and calculate frequency distribution of chosen variables.</p><p><strong>Code:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*PWekqhm6XhyDDkVEDfW8fw.png" /></figure><p><strong>Code Description:</strong></p><p><strong>Step 1</strong>: Import necessary libraries</p><p><strong>Step 2</strong>: Read data file</p><p><strong>Step 3</strong>: Count the variable rows and display along with variable column</p><p><strong>Output:</strong></p><p>213<br>16<br>counts for Country — Data availble for which Country<br>Paraguay 1<br>United States 1<br>Cambodia 1<br>China 1<br>Aruba 1<br> ..<br>Dominica 1<br>French Polynesia 1<br>Liberia 1<br>Kuwait 1<br>Gabon 1<br>Name: country, Length: 213, dtype: int64</p><p>percentages for Country — Data availble for which Country<br>Paraguay 0.004695<br>United States 0.004695<br>Cambodia 0.004695<br>China 0.004695<br>Aruba 0.004695<br> …<br>Dominica 0.004695<br>French Polynesia 0.004695<br>Liberia 0.004695<br>Kuwait 0.004695<br>Gabon 0.004695<br>Name: country, Length: 213, dtype: float64</p><p>counts for Income of person — country wise average income per person<br>12505.2125447354 1<br>27110.731590755 1<br>5188.9009351913 1<br>276.200412964869 1<br>15822.1121405699 1<br> ..<br>4495.04626152988 1<br>2221.18566404139 1<br>1324.19490626644 1<br>1383.40186887912 1<br>320.771889948584 1<br>Name: incomeperperson, Length: 191, dtype: int64</p><p>percentages for Income of person — country wise average income per person<br>12505.2125447354 0.004695<br>27110.731590755 0.004695<br>5188.9009351913 0.004695<br>276.200412964869 0.004695<br>15822.1121405699 0.004695<br> …<br>4495.04626152988 0.004695<br>2221.18566404139 0.004695<br>1324.19490626644 0.004695<br>1383.40186887912 0.004695<br>320.771889948584 0.004695<br>Name: incomeperperson, Length: 191, dtype: float64</p><p>counts for Alcohol consumption — in liters<br>8.7 1<br>.74 1<br>.32 1<br>8.65 1<br>3.92 1<br> ..<br>4.98 1<br>3.99 1<br>4.39 1<br>8.84 1<br>6.28 1<br>Name: alcconsumption, Length: 181, dtype: int64<br>percentages for Alcohol consumption — in liters<br>8.7 0.004695<br>.74 0.004695<br>.32 0.004695<br>8.65 0.004695<br>3.92 0.004695<br> …<br>4.98 0.004695<br>3.99 0.004695<br>4.39 0.004695<br>8.84 0.004695<br>6.28 0.004695<br>Name: alcconsumption, Length: 181, dtype: float64</p><p>counts for Life expectancy –in years<br>81.012 1<br>78.371 1<br>73.979 2<br>68.846 1<br>74.576 1<br> ..<br>76.835 1<br>48.398 1<br>75.632 1<br>51.088 1<br>68.494 1<br>Name: lifeexpectancy, Length: 190, dtype: int64</p><p>percentages for Life expectancy –in years<br>81.012 0.004695<br>78.371 0.004695<br>73.979 0.009390<br>68.846 0.004695<br>74.576 0.004695<br> …<br>76.835 0.004695<br>48.398 0.004695<br>75.632 0.004695<br>51.088 0.004695<br>68.494 0.004695<br>Name: lifeexpectancy, Length: 190, dtype: float64</p><p><strong>Conclusion:</strong></p><ul><li>Here my variables are not categorical. That’s why the percentage is unusable.</li></ul><p><strong>Extra:</strong></p><ul><li>Find the number of empty shells in the data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*2kPI5QBPUlMySa7mk4JcEQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*F9PVTVSJvLffXb_k_rk6jQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7e25dc28d93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Management and Visualization -Week 1]]></title>
            <link>https://dipikaparbatsinhpawar.medium.com/data-management-and-visualization-week-1-a24d7382eb1b?source=rss-b2102bc32e63------2</link>
            <guid isPermaLink="false">https://medium.com/p/a24d7382eb1b</guid>
            <dc:creator><![CDATA[Dipika Parbatsinh Pawar]]></dc:creator>
            <pubDate>Mon, 24 Aug 2020 04:57:02 GMT</pubDate>
            <atom:updated>2020-08-24T04:57:02.515Z</atom:updated>
            <content:encoded><![CDATA[<p>My name is Dipika Pawar and this blog is a part of<a href="https://www.coursera.org/learn/data-visualization/home/welcome"> Data Management and Visualization</a> course on coursera. The submission of the assignments will be in the form of blogs. So I choose medium as my medium of assignment.</p><p><strong>Assignment 1:</strong></p><p>In assignment 1, we have to choose dataset on which we have to work for the whole course. The five code books are given through which we have to select a subcategory and two topics/ variable on which we want to work.</p><p><strong>STEP 1: Choose a data set that you would like to work with.</strong></p><p>After reviewing five codebooks, I have decide to go with “portion of the <strong>GapMinder”. </strong>This data includes one year of numerous country-level indicators of health, wealth and development. I want work on health issue is the main reason to choose this handbook. In today’s world, the average life expectancy is increased. But some intoxication cause early death.</p><p><strong>STEP 2.</strong> <strong>Identify a specific topic of interest</strong></p><p>As I want to explore the average life expectancy including some intoxication, I would like to go with alcohol consumption and life expectancy. As the alcohol consumption is so injurious to health I would like to aim this issue to how much it’s dangerous. So I’m considering how the alcohol consumption will effect to health and other parameters or which parameters are related to to alcohol consumption.</p><p><strong>STEP 3. Prepare a codebook of your own</strong></p><p>As, GapMinder includes variables apart from health (wealth, development). So here I’m considering only incomeperperson, alcconsumption and lifeexpectancy as variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*oaxARti-c0wzG1pWWVxL9w.png" /></figure><p><strong>STEP 4. Identify a second topic that you would like to explore in terms of its association with your original topic.</strong></p><p>The second topic which I would like to explore is urbanrate. While looking at the codebook, I thought that there might be possibility that urban rate is connected to alcohol consumption. We can see in urban area, people are less aware of their health and consume more toxic.</p><p><strong>STEP 5.</strong> <strong>Add questions/items/variables documenting this second topic to your personal codebook.</strong></p><p>Is there any relation between urban rate and alcohol consumption?</p><p>Is there any relation between life expectancy and alcohol consumption?</p><p>Is there any relation between Income and alcohol consumption?</p><p>The final Codebook:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*J-QSXZwVXgNwTEDbSVtOoQ.png" /></figure><p><strong>STEP 6. Perform a literature review to see what research has been previously done on this topic</strong></p><p>For the relation between urbanrate and alcohol consumption, I search so much on google scholar but there is not a single paper on it. When I had search on google itself, I got to know that there is nor direct relation between this two. The relation as in terms of stress and culture. Those can be in city and urban are also. So I don’t have to consider this term(urbanrate).</p><p>For the relation between life expectancy and alcohol consumption, I got lots of articles on it so do with income and alcohol consumption. Here are few articles and overview of their content.</p><h4>Lifetime income patterns and alcohol consumption: Investigating the association between long- and short-term income trajectories and drinking[1]</h4><p>Overview: In this paper, authors evaluated the relationship between long-term and short-term measures of income. They used the data of US Panel Study on Income Dynamics. They also gave inference like the low income associated with heavy consumption. “Lifetime income patterns may have an indirect association with alcohol use, mediated through current socioeconomic position.”[1]</p><p><strong>A Review of Expectancy Theory and Alcohol Consumption[2]</strong></p><p>According to their study , “Expectancy manipulations and alcohol consumption: three studies in the laboratory have shown that increasing positive expectancies through word priming increases subsequent consumption and two studies have shown that increasing negative expectancies decreases it”[2]</p><h4>Alcohol-related mortality by age and sex and its impact on life expectancy: Estimates based on the Finnish death register[3]</h4><p>In this article, the author studied plausible results on the connection between alcohol-related mortality and age and sex. Here are few statistics, “According to the results, 6% of all deaths were alcohol related. These deaths were responsible for a 2 year loss in life expectancy at age 15 years among men and 0.4 years among women, which explains at least one-fifth of the difference in life expectancies between the sexes. In the age group of 15–49 years, over 40% of all deaths among men and 15% among women were alcohol related. In this age group, over 50% of the mortality difference between the sexes results from alcohol-related deaths”[3]</p><p><strong>STEP 7. Based on your literature review, develop a hypothesis about what you believe the association might be between these topics. Be sure to integrate the specific variables you selected into the hypothesis.</strong></p><p>After exploring such articles, they are enough to establish the correlation between alcohol consumption and life expectancy and also with Income (apart from these three). After certain observation, following are my hypothesis:</p><ul><li>The alcohol consumption is highly correlated with life expectancy.</li><li>The social culture , group of people associated with person, stress and Income have direct correlation with alcohol consumption.</li><li>Urban rate is not directly connected to alcohol consumption.</li></ul><p><strong>Final Codebook:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*oaxARti-c0wzG1pWWVxL9w.png" /></figure><p><strong>Reference:</strong></p><p>[1]Cerdá, Magdalena, et al. “Lifetime Income Patterns and Alcohol Consumption: Investigating the Association between Long- and Short-Term Income Trajectories and Drinking.” <em>Social Science &amp; Medicine</em>, vol. 73, no. 8, 2011, pp. 1178–1185., doi:10.1016/j.socscimed.2011.07.025.</p><p>[2] Jones, Barry T., et al. “A Review of Expectancy Theory and Alcohol Consumption.” <em>Addiction</em>, vol. 96, no. 1, 2001, pp. 57–72., doi:10.1046/j.1360–0443.2001.961575.x.</p><p>[3]Makela, P. “Alcohol-Related Mortality by Age and Sex and Its Impact on Life Expectancy.” <em>The European Journal of Public Health</em>, vol. 8, no. 1, 1998, pp. 43–51., doi:10.1093/eurpub/8.1.43.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a24d7382eb1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Few things which come to every college fresher’s Mind]]></title>
            <link>https://dipikaparbatsinhpawar.medium.com/few-things-which-come-to-every-college-freshers-mind-d6fb2b88bb1d?source=rss-b2102bc32e63------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6fb2b88bb1d</guid>
            <dc:creator><![CDATA[Dipika Parbatsinh Pawar]]></dc:creator>
            <pubDate>Tue, 14 Jul 2020 16:13:06 GMT</pubDate>
            <atom:updated>2020-07-14T16:18:08.706Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*fLxp3k_p28eEFtDo-sT-tw.jpeg" /><figcaption><a href="https://www.theguardian.com/education/2012/sep/19/lonely-in-freshers-week">https://www.theguardian.com/education/2012/sep/19/lonely-in-freshers-week</a></figcaption></figure><p>As a student, when we come out from school , a comfort zone ( where we don’t even fill a board examination application by ourselves) an unexpected change enters in our life. Some of the people took admission in those colleges, where they even don’t know single person (just like me). On the first day of college many questions rise in our minds. For an example, Oh my god!!! he/she is looking so handsome/gorgeous than me, how will I learn this type of English or how will I manage to document it, etc. In the world full of competition, we want to move forward and take the challenges. But the inner us leave such opportunities or avoid to face difficulties. Just because our one mindset that “I’m alone”. At least a single moment in a day comes when we taught this.</p><p>This is a huge myth. As time passes, we make friends, we enjoy lectures, we feel canteen time, bunk classes, do projects, and many more. Always believe in your self. You are going to rock definitely one day. Their are many people in this world, but we may survive with the help of only one single person. You just have to find that person.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6fb2b88bb1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>