<?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[My Data Science Journey - Medium]]></title>
        <description><![CDATA[I will mention my progress in Data Science. I will publish a new story for every Friday. - Medium]]></description>
        <link>https://medium.com/my-data-camp-journey?source=rss----e1c34035004e---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>My Data Science Journey - Medium</title>
            <link>https://medium.com/my-data-camp-journey?source=rss----e1c34035004e---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:37:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/my-data-camp-journey" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Predictive Analysis in Python]]></title>
            <link>https://medium.com/my-data-camp-journey/predictive-analysis-in-python-97ca5b64e97f?source=rss----e1c34035004e---4</link>
            <guid isPermaLink="false">https://medium.com/p/97ca5b64e97f</guid>
            <category><![CDATA[predictive-analytics]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Ayşe Bat]]></dc:creator>
            <pubDate>Fri, 22 Mar 2019 19:49:36 GMT</pubDate>
            <atom:updated>2022-08-09T07:06:24.153Z</atom:updated>
            <content:encoded><![CDATA[<p>I am a newbie to machine learning, and I will be attempting to work through predictive analysis in Python to practice how to build a logistic regression model with meaningful variables.</p><h4>What is predictive analysis?</h4><p>The predictive analysis makes predictions on what might happen in the future using historical data. The data is gathered in basetable which is consist of three important components: population, the candidate predictors, and target. <strong>The population </strong>is the group of people or objects you wish to make predictions for. The candidate<strong> predictor</strong> describes the people or objects in the population, which given information could use the predict the event. Finally, <strong>the target </strong>has information about the events to predict. it is one of the events that occur and zero otherwise.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hycx0kyvdC3OBRL0Ogv_zQ.png" /><figcaption>Structure of the base table</figcaption></figure><p>In this predictive analysis, we are going to consider the non-profit organization which has a donor database with people who donated in the past. This organization considering sending a letter to its donors to ask them to donate to a specific project.</p><ul><li>One option here is to send the letter to all the candidate donors. But, this could be very expensive.</li><li>The predictive analysis here allows us to determine the donors that are most likely to donate.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*9KjYelWbTykgcpiYmxKwsg.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7903b7f68a4a7a31be3583325368db56/href">https://medium.com/media/7903b7f68a4a7a31be3583325368db56/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*YXp7ZZPuw6aMG5WFn8IcHQ.png" /></figure><h4>Logistic Regression</h4><p><strong>Logistic regression</strong> is a predictive analysis that makes predictions about whether something is True(1) or not(0). It is widely used for classifying the data and explaining the relationship between the binary variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjTiGpaaeepaO4mKMhmZFg.png" /><figcaption>Logistic Regression</figcaption></figure><p>If we plot the target as a function of age for all donors and then we fit a regression line through points, it is of the form a*x+b, with a positive number. <em>a </em>is called the<em> </em><strong><em>coefficient</em></strong> of age, and<em> b</em> is called the <strong><em>intercept</em></strong>. If we plot the target as a function of the time since the last donation for each donor, it can be seen that those who recently donated, are more likely to donate. in this case, the coefficient of recency is negative.</p><p>We could make a prediction using one variable or a more complicated model adding other variables. We can build a logistic regression model using the module<em> linear_model</em> from scikit-learn.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee3e4d1a891c00a57a8c6f1cb8f18fc2/href">https://medium.com/media/ee3e4d1a891c00a57a8c6f1cb8f18fc2/href</a></iframe><pre>#result of printing<br>0.007178355658921441 age<br>0.11430414536794431 gender_F<br>-0.0013087501133203447 time_since_last_gift<br>[-2.54149728]</pre><p>So, our logistic regression model looks as follows:</p><pre>-2.5 + 0.0072* age + 0.1143 *gender_F - 0.0011* time_since_last_gift</pre><p>For example, we have 70 years old female person who made the last donation 120 days ago.</p><pre>= -2.5 + 0.0072* 70 + 0.1143 *1 - 0.0011* 120<br>= -2.137</pre><pre>#Then we calculate the logit function:<br>1/(1+e^-(-2.0123)) = 0.117 </pre><p>The logit function is used for the probabilities for the values between 0 and 1. As you can see from the above example for the given data which is 70 years old female person who made the last donation 120 days ago. We calculated the probability of making a donation is 11%.</p><p>The good news is we don’t have to calculate the predicted probabilities manually in python. We are going to use the <em>predict_proba</em> function on the <em>logreg</em> object to calculate the probabilities. The <em>predict_proba</em> has two-dimensional arrays. The first number is the probability that the donor will not donate (target 0), and the second number is the probability of the donor will donate (target 1).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/54c7627594616f6eaa10d30ab09b0550/href">https://medium.com/media/54c7627594616f6eaa10d30ab09b0550/href</a></iframe><pre>[[0.93427169 0.06572831]<br> [0.9454883  0.0545117 ]<br> [0.9185279  0.0814721 ]<br> [0.95269877 0.04730123]<br> [0.94745512 0.05254488]]</pre><h4>Calculating AUC</h4><p>The AUC value assesses how well a model can order observations from a low probability to be the target to a high probability to be the target. In Python, the <em>roc_auc_score</em> function can be used to calculate the AUC of the model. It takes the true values of the target and the predictions as arguments.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/567fa33784de2ff104ffcdc237be2937/href">https://medium.com/media/567fa33784de2ff104ffcdc237be2937/href</a></iframe><pre>#result of the auc calculation using the variable of age, gender_F, time_since_last_gift<br>0.63</pre><h4>Variable Selection</h4><p>We have more variables that we could include in our model but we have to make wisely set of variable selections for our model.</p><p>Let’s define a function that calculates AUC for a given set of a variable of the model that uses this variable set as predictors named as auc_score.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ba6a9716548680d29493f73275dad93/href">https://medium.com/media/6ba6a9716548680d29493f73275dad93/href</a></iframe><pre>#result of auc score using the max_gift, min_gift, and mean_gift<br>0.7125</pre><ul><li>We are going to define thenext_best_variable function which finds the variable that should be added in the next step to the variable list.</li><li>We write a for loop iterate over all column variables to find the best variable for our model.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e7099aece1ab3a9db1036aad2aa2453/href">https://medium.com/media/7e7099aece1ab3a9db1036aad2aa2453/href</a></iframe><pre>Variable added in step 1 is max_gift<br>Variable added in step 2 is number_gift<br>Variable added in step 3 is time_since_last_gift<br>Variable added in step 4 is mean_gift<br>Variable added in step 5 is age<br>[&#39;max_gift&#39;, &#39;number_gift&#39;, &#39;time_since_last_gift&#39;, &#39;mean_gift&#39;, &#39;age&#39;]</pre><pre>Let’s find out the AUC Score for our current variable<br>current_list_auc = auc_score(current_variable, ‘target’, basetable)<br>print(current_list_auc)</pre><pre>0.768756710130262</pre><p>The credit goes to <a href="https://www.datacamp.com/courses/foundations-of-predictive-analytics-in-python-part-1">Foundations of Predictive Analytics in Python at the DataCamp </a>course. In this course, you will learn how to build a logistic regression model with meaningful variables (covered here). You will also learn how to use this model to make predictions and how to present it and its performance to business stakeholders. I totally recommended the course.</p><h4>Final Thought</h4><p>You may find this study in my <a href="https://github.com/aysbt/DataCamp/blob/master/Foundations_of_Predictive_Analytics_in_Python%20.ipynb">GitHub</a> account as part of the Datacamp repository.</p><p>I have written this article to improve my data analytic skills and machine learning skills so I am still a learner. Please let me know any additional information or comment on this article.</p><p>Follow me on<a href="https://twitter.com/aaysbt"> Twitter</a>, <a href="http://linkedin/">Linkedin</a>, or <a href="https://medium.com/@aaysbt">Medium.</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FxUA7aN1MTCZx97V1Ic%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Filiza-iliza-shlesinger-xUA7aN1MTCZx97V1Ic&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FxUA7aN1MTCZx97V1Ic%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/577d368f6ba5853de6cfb0af44705e96/href">https://medium.com/media/577d368f6ba5853de6cfb0af44705e96/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97ca5b64e97f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/my-data-camp-journey/predictive-analysis-in-python-97ca5b64e97f">Predictive Analysis in Python</a> was originally published in <a href="https://medium.com/my-data-camp-journey">My Data Science Journey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Import Your data from Different sources using Python]]></title>
            <link>https://medium.com/my-data-camp-journey/import-your-data-from-different-sources-using-python-fd253330aa2a?source=rss----e1c34035004e---4</link>
            <guid isPermaLink="false">https://medium.com/p/fd253330aa2a</guid>
            <category><![CDATA[hdf5]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[excel]]></category>
            <category><![CDATA[import-data]]></category>
            <category><![CDATA[data-analysis]]></category>
            <dc:creator><![CDATA[Ayşe Bat]]></dc:creator>
            <pubDate>Fri, 15 Mar 2019 20:14:16 GMT</pubDate>
            <atom:updated>2019-03-15T20:14:16.017Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*0nZNUPTquNxWwFYOb4foiQ.png" /></figure><p>The data could have come from different sources, we need to ability to import and manage this file, successfully. So, in this source, we will look at how to import data from different file type. We will learn to import the files from a flat file(.txt, .csv), other types of software (Excel, Stata, SAS, Matlab), and.</p><h4>Import data from Flat File</h4><p>To check out any plain text file, you can use the Python’s open() function to open a connection to the file.</p><pre>#assign the file name to the variable string<br>file_name = &#39;file_name.txt&#39;</pre><pre>#pass the file name to the open function using &#39;r&#39; mode <br>file = open(file_name, mode=&#39;r&#39;)# only for reading</pre><pre>#to connection to the file apply the read() function<br>text =file.read()<br>#close the connection<br>file.close()</pre><p>By using a context manager construct that allows us to create a context in which you can execute commands with the file open. We can avoid having to close to connection to the file using the ‘with’ statement. For the large files, we may want to print a few lines. You can use ‘file.readline()’ function to execute the first line of a text file. If you execute the same comment again, the second line will be printing and so on.</p><pre>#By using the with open we don&#39;t need to close the connection.<br>with open(file_name, &#39;r&#39;) as file:<br>     print(file.read())</pre><pre>#print out the file line by line executing with file.readline()<br>with open(file_name, &#39;r&#39;) as file:<br>     print(file.readline())<br>     print(file.readline())<br>     print(file.readline())</pre><h4>Importing Flat File using Numpy</h4><p>Flat files are a basic text file containing records, that is table data, without structured relationships.</p><p>We could use the numpy function loadtxt()</p><ul><li>The first argument will be the filename.</li><li>The second will be the delimiter which can take &#39;,&#39; for comma separated file and &#39;\t&#39; for tab-delimited file</li><li>skiprows allows you to specify how many rows you wish to skip.</li><li>usecols takes a list of the indices of the columns you wish to keep.</li><li>dtype=’str’ will ensure that all entries are imported as a string.</li></ul><pre>import numpy as np<br>file_name = ‘data/mnist_kaggle_some_rows.csv’</pre><pre>#Default delimiter is white space so, we need the specify delimiter parameter explicitly.<br>data = np.loadtxt(file_name, delimiter=’,’)</pre><pre>#we are reading a file as a numpy array<br>print(type(data))<br>print(data)</pre><pre>&lt;class &#39;numpy.ndarray&#39;&gt;<br>[[1. 0. 0. ... 0. 0. 0.]<br> [0. 0. 0. ... 0. 0. 0.]<br> [1. 0. 0. ... 0. 0. 0.]<br> ...<br> [2. 0. 0. ... 0. 0. 0.]<br> [0. 0. 0. ... 0. 0. 0.]<br> [5. 0. 0. ... 0. 0. 0.]]</pre><h4>Importing different datatypes:</h4><p><em>Let’s import the text file which has</em></p><ul><li>text header, consisting of a string</li><li>tab-delimited</li></ul><p>Due to the file containing string header we need to handle it. If we import the file using loadtxt() function without handling string file we could get the ValueError.</p><ul><li>Alternative 1: We can set the dtype = str to avoid to ValueError,</li><li>Alternative 2: We can skip the first row, using the skiprows argument!</li></ul><pre>#Alternative 1:<br>file_sea_slug = ‘data/seaslug.txt’<br>data_alt_1 = np.loadtxt(file_sea_slug, delimiter=’\t’, dtype=str)<br>print(type(data_alt_1))<br>print(data_alt_1[0:5])</pre><pre>&lt;class &#39;numpy.ndarray&#39;&gt;<br>[[&#39;Time&#39; &#39;Percent&#39;]<br> [&#39;99&#39; &#39;0.067&#39;]<br> [&#39;99&#39; &#39;0.133&#39;]<br> [&#39;99&#39; &#39;0.067&#39;]<br> [&#39;99&#39; &#39;0&#39;]]</pre><pre>#---------------------------------------------------------------#</pre><pre>#Alternative 2:<br>data_alt_2 = np.loadtxt(file_sea_slug, delimiter=&#39;\t&#39;, skiprows=1)<br>print(type(data_alt_2))<br>print(data_alt_2[0:9])</pre><pre>&lt;class &#39;numpy.ndarray&#39;&gt;<br>[[9.90e+01 6.70e-02]<br> [9.90e+01 1.33e-01]<br> [9.90e+01 6.70e-02]<br> [9.90e+01 0.00e+00]<br> [9.90e+01 0.00e+00]<br> [0.00e+00 5.00e-01]<br> [0.00e+00 4.67e-01]<br> [0.00e+00 8.57e-01]<br> [0.00e+00 5.00e-01]]</pre><p>To import datasets which have different datatypes in different columns; for example, one column may contain strings and another float. The function np.loadtxt() will freak at this. There is another function, np.genfromtxt(), which can handle such structures. If we pass dtype=None to it, it will figure out what types each column should be.</p><pre>data <strong>=</strong> np.genfromtxt(file_name, delimiter<strong>=</strong>&#39;,&#39;, names<strong>=True</strong>, dtype<strong>=None</strong>)</pre><ul><li>The first argument is the filename</li><li>The second specifies the delimiter</li><li>The third argument names tell us there is a header (names=True)</li><li>dtype=None is representing the different data type</li></ul><p><em>There is also another function </em><em>np.recfromcsv()that behaves similarly to np.genfromtxt(), except that its default dtype is None!</em></p><pre># Let’s look at titanic.csv <br># ‘,’, comma separated<br># there is a header<br># There is string and number data type in it.<br>titanic = np.genfromtxt(‘data/titanic_sub.csv’, delimiter=’,’, names=True, dtype=None)<br>print(titanic[0:2])</pre><pre>[(1, 0, 3, b&#39;male&#39;, 22., 1, 0, b&#39;A/5 21171&#39;,  7.25  , b&#39;&#39;, b&#39;S&#39;)<br> (2, 1, 1, b&#39;female&#39;, 38., 1, 0, b&#39;PC 17599&#39;, 71.2833, b&#39;C85&#39;, b&#39;C&#39;)<br>]</pre><pre># using np.recfromcsv()<br>titanic_2 = np.recfromcsv(&#39;data/titanic_sub.csv&#39;)<br>print(titanic_2[0:2])</pre><pre>[(1, 0, 3, b&#39;male&#39;, 22., 1, 0, b&#39;A/5 21171&#39;,  7.25  , b&#39;&#39;, b&#39;S&#39;)<br> (2, 1, 1, b&#39;female&#39;, 38., 1, 0, b&#39;PC 17599&#39;, 71.2833, b&#39;C85&#39;, b&#39;C&#39;) ]</pre><h4>Importing Data using Pandas</h4><p>What we learn so far is to import a bunch of different types of flat files into python as Numpy arrays. Although the numpy array is incredibly useful and has numerous of purpose, they can not handle the data as two dimensional labeled data structure.</p><p>Pandas offer us to the DataFrame, which has observations (rows), and variables(columns).</p><pre>#import pandas <br>import pandas as pd</pre><pre>#import titanic as dataframe<br>df_titanic = pd.read_csv(&#39;data/titanic_sub.csv&#39;)</pre><pre>print(type(df_titanic))</pre><pre>#let&#39;s look at first 5 row<br>df_titanic.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*gQ4GHKt97PpwMlrRHd23ew.png" /></figure><p>Handling read_csv() function under different circumstances</p><ul><li>sep: Stands for a separator, a default is ‘,‘ as in .csv(comma separated values): We could specify if needed.</li><li>header= None: Load a CSV with no headers</li><li>names=[&#39;column_name1&#39;,&#39;column_name2&#39;]: Load a .csv while specifying column names</li><li>index_col=&#39;date&#39;: Load a .csv with setting the index column to column name like we would like set index as a date.</li><li>na_values=[&#39;NA&#39;]: Load a .csv while specifying “NA” as missing values.</li><li>skiprows=3: Load a .csv while skipping the top 3 rows</li></ul><h4>Importing Other File Types into Python</h4><ul><li>Excel spreadsheets</li><li>Matlab files</li><li>SAS files</li><li>STATA files</li><li>HDF5 files</li></ul><p><strong>Pickle files: </strong>Pickling means converting the object into a sequence of bytes, or byte-stream. <br><strong>Warning </strong><em>Loading pickled data received from untrusted sources can be unsafe. Firstly, we are going to create our pickle file from Titanic DataFrame.</em></p><pre>#import pickle<br>import pickle</pre><pre>#Let’s save the Titanic data frame into a pickle file<br>pd.to_pickle(df_titanic, ‘data/titanic_pickle.pkl’)</pre><pre>#first try with with open<br># &#39;rb&#39; reading and binary<br>with open (&#39;data/titanic_pickle.pkl&#39;,&#39;rb&#39;) as file:<br>    data = pickle.load(file)<br>#reading the data type as DataFrame<br>print(type(data))<br>print(data[0:3])</pre><pre>&lt;class &#39;pandas.core.frame.DataFrame&#39;&gt;<br>   PassengerId  Survived  Pclass     Sex   Age  SibSp  Parch  \<br>0            1         0       3    male  22.0      1      0   <br>1            2         1       1  female  38.0      1      0   <br>2            3         1       3  female  26.0      0      0   </pre><pre>             Ticket     Fare Cabin Embarked  <br>0         A/5 21171   7.2500   NaN        S  <br>1          PC 17599  71.2833   C85        C  <br>2  STON/O2. 3101282   7.9250   NaN        S</pre><pre>#---------------------------------------------------------------#</pre><pre>#Let&#39;s read with pandas<br>unpickled_df = pd.read_pickle(&#39;data/titanic_pickle.pkl&#39;)<br>#unpickled_df.head()</pre><p><strong>Excel File: </strong>You may need to deal with excel file at some point.<strong> </strong>Here, you’ll learn how to use pandas to import Excel spreadsheets.</p><ul><li>Use the pandas’ ExcelFile() to load the .xlsx file</li><li>Figure out what is the sheets name using .sheet_names</li><li>We could load the particular sheets into a DataFrame for this we need to apply a parse() method with a single parameter, which is either the name of string or the index as a float of the sheets that you wish to load.</li></ul><pre>#load the battledeath.xlsx into the excel_data variable<br>excel_data = pd.ExcelFile(‘data/battledeath.xlsx’)</pre><pre>#print the sheet name <br>print(excel_data.sheet_names)</pre><pre>[&#39;2002&#39;, &#39;2004&#39;]</pre><pre>#Load the sheet into dataframe <br>df1 = excel_data.parse(&#39;2004&#39;)<br>df2 = excel_data.parse(&#39;2002&#39;)<br>print(df1.head())</pre><pre>War(country)      2004<br>0  Afghanistan  9.451028<br>1      Albania  0.130354<br>2      Algeria  3.407277<br>3      Andorra  0.000000<br>4       Angola  2.597931</pre><blockquote>It could be read using <em>pd.read_excel()</em> function.</blockquote><pre># we could specify the sheet_name<br>excel_df = pd.read_excel(‘data/battledeath.xlsx’, index_col=0, sheet_name=’2004&#39;)</pre><p><strong>SAS File: Statistical analysis System</strong></p><ul><li>Business analysis and biostatistics</li><li>Advanced analysis, Multivariable analysis</li><li>Data management</li><li>Predictive analytics</li><li><em>sas7bdat</em>: dataset files &amp;<em> sas7cdat:</em> catalog file</li></ul><pre>#if the sas7bdat dosen&#39;t install your conda you could install first using followinf line.<br>pip install sas7bdat</pre><pre># import the sas7bdat <br>from sas7bdat import SAS7BDAT<br>with SAS7BDAT (&#39;data/sales.sas7bdat&#39;) as file:<br>    df_sas = file.to_data_frame()<br>print(df_sas.head())</pre><pre>YEAR     P           S<br>0  1950.0  12.9  181.899994<br>1  1951.0  11.9  245.000000<br>2  1952.0  10.7  250.199997<br>3  1953.0  11.3  265.899994<br>4  1954.0  11.2  248.500000</pre><p><strong>Stata File: “Statistics” + “data”</strong></p><ul><li>Importing Stata files as DataFrames using the pd.read_stata()from pandas.</li><li>Academic &amp; social sciences research</li></ul><pre>df_stata = pd.read_stata(&#39;data/disarea.dta&#39;)</pre><p><strong>HDF5: Hierarchical Data Format version 5</strong></p><ul><li>Storing for a large quantity of numerical data</li><li>Datasets can be hundreds of gigabytes, or terabytes</li></ul><pre>#h5py library<br>import h5py<br>df_h5py = h5py.File(‘data/L-L1_LOSC_4_V1–1126259446–32.hdf5’, ‘r’)<br>print(type(df_h5py))<br>print(df_h5py)</pre><pre>&lt;class &#39;h5py._hl.files.File&#39;&gt;</pre><pre>#we could explore the hierarhical structure</pre><pre>for key in df_h5py.keys():<br>    print(key)</pre><pre>#Each of these HDF group which we could think thse group as directories.</pre><pre>meta<br>quality<br>strain</pre><pre>print(type(df_h5py[&#39;meta&#39;]))<br>&lt;class &#39;h5py._hl.group.Group&#39;&gt;</pre><pre>for key in df_h5py[&#39;meta&#39;].keys():<br>    print(key)</pre><pre>Description<br>DescriptionURL<br>Detector<br>Duration<br>GPSstart<br>Observatory<br>Type<br>UTCstart</pre><h4>Final Thought</h4><p>You may find this study in my <a href="https://github.com/aysbt/DataCamp/blob/master/Importing_Data_in_Python_part1.ipynb">githup</a> account as part of Datacamp repository.</p><p>I have written this article to improve my data analytic skills so I am still a learner. Please let me know any additional information or comment on this article.</p><p>Follow me on<a href="https://twitter.com/aaysbt"> Twitter</a>, <a href="http://linkedin/">Linkedin</a> or in <a href="https://medium.com/@aaysbt">Medium.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd253330aa2a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/my-data-camp-journey/import-your-data-from-different-sources-using-python-fd253330aa2a">Import Your data from Different sources using Python</a> was originally published in <a href="https://medium.com/my-data-camp-journey">My Data Science Journey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brief Introduction to Statistical Analysis using Python]]></title>
            <link>https://medium.com/my-data-camp-journey/brief-introduction-to-statistical-analysis-using-python-94545216198c?source=rss----e1c34035004e---4</link>
            <guid isPermaLink="false">https://medium.com/p/94545216198c</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statistical-analysis]]></category>
            <category><![CDATA[statistical-learning]]></category>
            <dc:creator><![CDATA[Ayşe Bat]]></dc:creator>
            <pubDate>Fri, 08 Mar 2019 14:11:42 GMT</pubDate>
            <atom:updated>2019-03-08T14:11:42.755Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*_Whjy0D-uBXpgIPcW5QTPA.jpeg" /></figure><p>Statistical thinking is really important for data analysis, in this article I will emphasize the core of the statistical analysis.</p><blockquote>Graphical Exploratory Data Analysis</blockquote><ul><li>Exploratory Data Analysis (EDA)</li><li>Empirical cumulative distribution functions (ECDF)</li></ul><blockquote>Quantitative Exploratory Data Analysis</blockquote><ul><li>Mean</li><li>Median</li><li>Variance and standard deviation</li><li>Covariance, and Pearson Correlation Coefficient</li></ul><h3>Graphical Exploratory Data Analysis</h3><p>Exploring your data (EDA) is a crucial step in your analysis.</p><ul><li>Organizing</li><li>Plotting</li><li>Computing a few numerical summaries</li></ul><p>For EDA, we are going to explore the 2008 US swing state election result which is at country level in each of the three major swing states of Pennsylvania, Ohio, and Florida.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*qHZRGbLqOqq9wMMns7Zh6w.png" /></figure><p>We take the Democratic share (dem_share) of the vote in the counties of all the three swing state and plot them as a histogram. We are interested in the fraction of the vote to Brack Obama in the county.</p><pre>#We can specified where the edge of the bars of histigrams are using the bins keyword<br># 20 evenly spaced bins will create<br>_ = plt.hist(swing_state[&#39;dem_share&#39;], bins =20)</pre><pre>#labeling the plot<br>_ = plt.xlabel(&#39;Percent of vote for Obama&#39;)<br>_ = plt.ylabel(&#39;Number of counties&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*CowZttyeWxnnUqms22RvKA.png" /></figure><p>With the bee swarm plot, we could plot the vote totals in three swing states. Each point in the plot represents the share of the vote Obama got into a single count. The y-axis gives us quantitative information.</p><pre>sns.swarmplot(x=’state’, y=’dem_share’, data=swing_state)<br>plt.xlabel(‘state’)<br>plt.ylabel(‘percent of vote for Obama’)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*v1MNm6Iq15EZjluhIZ_T7w.png" /></figure><ul><li>We can clearly see that Obama got less than 50% of the vote in the majority of counties in each of the three swing states.</li></ul><p><strong>Empirical cumulative distribution functions (ECDF): </strong>We are going to plot ECDF for the percentage of the vote for the Obama. The x-axis is a percent of the vote that vote for Obama. The y-axis is the fraction of data point that has a value smaller than the corresponding x-value.</p><pre>#We can use np.sort() to generate our x-data<br>x = np.sort(swing_state[&#39;dem_share&#39;])</pre><pre>#y-axis is evenly speaced data point with a max 1.<br>y = np.arange(1, len(x) +1)/len(x)</pre><pre>_ = plt.plot(x,y, marker =&#39;.&#39;, linestyle=&#39;none&#39;)<br>plt.xlabel(&#39;Percent of Vote for Obama&#39;)<br>plt.ylabel(&#39;ECDF&#39;)</pre><pre>#Keep the data off from plot edge<br>plt.margins(0.02) <br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*GIn1e8UUkfYpqjetj30lXg.png" /></figure><p><em>75% of counties in swing states had 50% or less of its people vote for Obama</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F8gNQZ9IpkcdiAjfOgN%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F8gNQZ9IpkcdiAjfOgN%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F8gNQZ9IpkcdiAjfOgN%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e362b0e98b434024c10e767dba9f9f1/href">https://medium.com/media/0e362b0e98b434024c10e767dba9f9f1/href</a></iframe><h3>Quantitative Exploratory Data Analysis</h3><p><strong>Mean</strong>: If you have a sample of <em>n</em> values, <em>xi</em>, the mean, <em>μ</em>, is the sum of the values divided by the number of values:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/93/1*9pGCnmcwjt-AoDdttSf7iw.png" /></figure><p><strong>Outliers:</strong> Data point whose value is far greater or less than most of the rest of the data.</p><ul><li><em>The mean was highly affected by outliers.</em></li></ul><p><strong>The median:</strong> is the middle value of the dataset and is immune to data that have extreme values. The median is the special name for the 50th percentile. Similarly, the 25th percentile is the value of the data point that is greater than 25% of the sorted data.</p><pre>print(&#39;Mean: &#39;, np.mean(swing_state[&#39;dem_share&#39;]))<br>print(&#39;Median: &#39;,np.median(swing_state[&#39;dem_share&#39;]))</pre><pre>Mean:  43.76441441441444<br>Median:  43.185</pre><pre>np.percentile(swing_state[&#39;dem_share&#39;], [25,50,75])<br>array([37.3025, 43.185 , 49.925 ])</pre><p>The Box plot was invented by John Tukey to display some of the statistical features of the data set based on percentiles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*4oeMkB1TvYn1UoT0SmtvHQ.png" /></figure><p>Here we look at the box plot for percent of the vote for Obama for different states.</p><ul><li>The center of boxes are shown the <strong>median</strong>: 50th</li><li>The edges of the boxes are shown the<strong> 25th and 75th </strong>percentile</li><li>The total height of the box contains 50% of the data and it is called interquartile range or <strong>IQR</strong></li><li>The whiskers extend the distance of 1.5 times IQR to the extent a distance of the data.</li><li>All points outside of the whiskers are called outliers.</li></ul><p><em>Let’s plot ECDF with the percentile points on it.</em></p><pre>x = np.sort(swing_state[&#39;dem_share&#39;])<br>y = np.arange(1, len(x) +1) /len(x)<br>percentiles = np.array([2.5, 25, 50, 75, 97.5])</pre><pre>_ = plt.plot(x,y, marker =&#39;.&#39;, linestyle=&#39;none&#39;)<br>plt.xlabel(&#39;percent of vote for Obama&#39;)<br>plt.ylabel(&#39;ECDF&#39;)</pre><pre>_ = plt.plot(per_vers_x, percentiles/100, marker=&#39;D&#39;, color=&#39;red&#39;, linestyle =&#39;none&#39;)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*xSWOWqNHzGmG57D6S6zC1A.png" /></figure><h4>Variance and standard deviation</h4><p><strong>Variance:</strong> is intended to describe the spread of the data. The variance is calculated as the average of the squared distance from the mean in python with numpy we can calculate the variance n<em>p.var()</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/155/1*3yUbp4D0UuJEjerD9wa23A.png" /></figure><p><em>xi−μ</em> is called deviation from mean so the variance is the mean squared deviation. The square root of the variance, σ, is called the <strong>standard deviation.</strong> Standard deviation (σ)is a reasonable metric for the spread of the data and calculated with <em>np.std()</em></p><pre>print(&#39;Variance: &#39;, np.var(swing_state[&#39;dem_share&#39;]))<br>print(&#39;Standart deviation: &#39;, np.std(swing_state[&#39;dem_share&#39;]))</pre><pre>Variance:  114.24649492735986<br>Standart deviation:  10.68861520157592</pre><p>To see how the standard deviation affects the distribution. Let’s plot the normal distribution also known as Gaussian distribution to see how different standard deviations affect the distributions with same mean value.</p><pre>#Draw 100,000 samples from a Normal distribution <br>#First samplehas a mean of 20 and a standard deviation of 1<br>sample_std1  =  np.random.normal(20, 1,   size=100000)<br>#Second has standard deviations of 3 <br>sample_std3  =  np.random.normal(20, 3,   size=100000)<br>#Third has standard deviations of 10<br>sample_std10 =  np.random.normal(20, 10,  size=100000)</pre><pre>#Plot a histograms of each of the samples; for each, use 100 bins<br>_ = plt.hist(sample_std1,  density=True, histtype=&#39;step&#39;, bins=100)<br>_ = plt.hist(sample_std3,  density=True, histtype=&#39;step&#39;, bins=100)<br>_ = plt.hist(sample_std10, density=True, histtype=&#39;step&#39;, bins=100)</pre><pre>_ = plt.legend((&#39;std = 1&#39;, &#39;std = 3&#39;, &#39;std = 10&#39;))<br>_ = plt.title(&quot;The normal distribution&quot;)<br>plt.ylim(-0.01, 0.42)<br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*6wqdtnTxyMt3M-Bn6arVAw.png" /></figure><h4>Covariance, and Pearson Correlation Coefficient</h4><p><strong>Covariance</strong> is a measure of the tendency of two variables to vary together. If we have two series,<em> X</em> and<em> Y,</em> their deviations from the mean are</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/132/1*UBS11rf21Ztzkv5yqQ5gXw.png" /></figure><p>where <em>μx</em> is the mean of <em>X</em> and <em>μy</em> is the mean of <em>Y</em>. If <em>X</em> and <em>Y</em> vary together, their deviations tend to have the same sign.</p><p>If we multiply them together, the product is <em>positive</em> when the deviations have the same sign and <em>negative</em> when they have the opposite sign. So adding up the products gives a measure of the tendency to vary together.</p><p><em>Covariance is the mean of these products:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/214/1*xn_d3c5yZXeS1QyxglEFxA.png" /></figure><p>where <em>n</em> is the length of the two series (they have to be the same length).</p><p><strong><em>We are going to make scatter plot for the percent of votes for Obama versus the total number of votes in each county.</em></strong></p><pre>mean_of_dem_share = np.mean(swing_state[&#39;dem_share&#39;])<br>mean_of_total_vote =np.mean(swing_state[&#39;total_votes&#39;])/1000</pre><pre>_ = plt.plot(swing_state[&#39;total_votes&#39;]/1000, swing_state[&#39;dem_share&#39;], marker=&#39;.&#39;,<br>            linestyle=&#39;none&#39;)<br>#drawing the mean of total votes<br>_ = plt.axvline(x=mean_of_total_vote, ymin=0, ymax= max(swing_state[&#39;total_votes&#39;]),<br>                color=&#39;red&#39;, zorder=1, alpha=0.8 )<br>_ = plt.text(480,45,&#39;Mean of percent for Obama&#39;, color=&#39;r&#39;)<br>#draw tha mean of percent of votes for Obama<br>_ = plt.axhline(y=mean_of_dem_share, xmin=0, xmax= max(swing_state[&#39;dem_share&#39;]),<br>                color=&#39;red&#39;, zorder=1, alpha=0.8)<br>_ = plt.text(100, 10, &#39;Mean of total votes&#39;, color=&#39;r&#39;)</pre><pre>#distance from mean<br>_ = plt.vlines(x=220, ymin=44, ymax=65., color=&#39;g&#39;)<br>_ = plt.hlines(y=65, xmin=85, xmax=220, color=&#39;b&#39;)</pre><pre>_ = plt.text(100, 70, &#39;distance from mean of total votes&#39;, color=&#39;b&#39;)<br>_ = plt.text(205,60,&#39;distance from mean of percent for Obama&#39;, color=&#39;g&#39;)<br>#_ =plt.axline()<br>#data point</pre><pre>_ = plt.xlabel(&#39;Total Votes (thousands)&#39;)<br>_ = plt.ylabel(&#39;Percent of Votes for Obama &#39;)</pre><pre>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*czYGAieSLi00a9FxIKkwhg.png" /></figure><p><em>if you look at the data point that we point out</em>: Covariance is the mean of the product of differences which it calculates using the distance from a mean of percent for Obama and distance from a mean of total votes.</p><p><strong>Positively Correlated:</strong> If <em>x</em> and <em>y</em> both tend to be above, or both below their respective means together then covariance is positive</p><p><strong>Negatively Correlated:</strong> If x is high while y is low then covariance is negative or anti-correlated.</p><p>If we want to have a more generally applicable measure of how two variables depend on each other, we want to be dimensionless. We can divide the covariance by standard deviation (σ) of x and y variables.</p><p><strong>Pearson’s correlation ( </strong><em>ρ</em><strong> ):</strong> Pearson’s correlation is always between <em>−1 </em>and <em>+1</em> (including both). The magnitude indicates the strength of the correlation. If the correlation is equal to the <em>1</em> means that two variables are perfectly correlated. The same is true if the correlation is equal to the <em>−1</em>means that the variables are negatively correlated, but for purposes of prediction, a negative correlation is just as good as a positive one. So if the correlation is equal to the 0, does that mean there is no relationship between the variables? Unfortunately, Pearson’s correlation only measures linear relationships.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/119/1*W6cB9MtcKxnQHaCyEJvE5A.png" /></figure><p>The covariance may be computed using the Numpy function np.cov(). For example, we have two sets of data<em> x</em> and <em>y,</em> np.cov(x, y) returns a 2D array where entries [0,1] and [1,0] are the covariances. Entry [0,0] is the variance of the data in x, and entry [1,1] is the variance of the data in y. This 2D output array is called the covariance matrix since it organizes the self- and covariance.</p><pre>Covariance_matrix = np.cov(swing_state[&#39;dem_share&#39;], swing_state[&#39;total_votes&#39;])<br>print(&#39;Covariance matrix between percent of vote for Obama and total votes is\n&#39;, Covariance_matrix)</pre><pre>Covariance matrix between percent of vote for Obama and total votes is<br> [[1.14763447e+02 8.17309362e+05]<br> [8.17309362e+05 2.02451039e+10]]</pre><pre># let&#39;s compare variance x from var and covariance matrix<br>print(&#39;1: Variance of X from np.var():&#39;, np.var(swing_state[&#39;dem_share&#39;]))<br>print(&#39;2: Variance of X from covariance matrix&#39;, Covariance_matrix[0,0])</pre><pre>1: Variance of y from np.var(): 20153909774.448013<br>2: Variance of y from covariance matrix 20245103936.323345</pre><pre>pearson_coefficient = np.corrcoef(swing_state[&#39;dem_share&#39;], swing_state[&#39;total_votes&#39;])<br>print(pearson_coefficient[0,1])</pre><pre>0.536197364958678</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fk53IkiREZ8FTW%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fk53IkiREZ8FTW%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fk53IkiREZ8FTW%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="266" frameborder="0" scrolling="no"><a href="https://medium.com/media/906f8096b48fc440dfcf1bb83d1412ce/href">https://medium.com/media/906f8096b48fc440dfcf1bb83d1412ce/href</a></iframe><h4>Final Thought</h4><p>The statistical analysis is more detailed and using the solve more complex problem. We just write a basic concept of a statistic. This term we mentioned in this article any data analytic should know. I will continue to write about statistical analysis.</p><p>You may find this study in my<a href="https://github.com/aysbt/DataCamp/blob/master/Statistical_Thinking_in_Python_course_1.ipynb"> githup</a> account as part of Datacamp repository.</p><p>I have written this article to improve my data analytic skills so I am still a learner. Please let me know any additional information or comment on this article.</p><p>Follow me on<a href="https://twitter.com/aaysbt"> Twitter</a>, <a href="http://linkedin/">Linkedin</a> or in <a href="https://medium.com/@aaysbt">Medium.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94545216198c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/my-data-camp-journey/brief-introduction-to-statistical-analysis-using-python-94545216198c">Brief Introduction to Statistical Analysis using Python</a> was originally published in <a href="https://medium.com/my-data-camp-journey">My Data Science Journey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preprocessing Data for Logistic Regression]]></title>
            <link>https://medium.com/my-data-camp-journey/preprocessing-data-for-logistic-regression-f311c937d765?source=rss----e1c34035004e---4</link>
            <guid isPermaLink="false">https://medium.com/p/f311c937d765</guid>
            <category><![CDATA[data-processing]]></category>
            <category><![CDATA[absenteeism]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Ayşe Bat]]></dc:creator>
            <pubDate>Fri, 01 Mar 2019 09:20:05 GMT</pubDate>
            <atom:updated>2019-03-01T09:20:04.917Z</atom:updated>
            <content:encoded><![CDATA[<p>As far as I understood, preprocessing the data is an important part of data analysis. In this article, I will show how to prepare the data for logistic regression using absenteeism data which is show the absenteeism at the company during work hour.</p><p>We’ll look at predicting absenteeism from work. More precisely we would like to know whether or not an employee can be expected to be missing for a specific number of hours in a given workday. Having such information in advance can improve our decision making.</p><p>We want to know for how many working hours an employee could be away from work based on information such as how far they live from their workplace. How many children and pets they have. Do they have higher education and so on. But firstly, We are going to prepare our data for logistic regression.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FgmeJRdWDgQ3mw%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FgmeJRdWDgQ3mw%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FgmeJRdWDgQ3mw%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="289" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb806fbc824041d9d895ea7b0432e518/href">https://medium.com/media/cb806fbc824041d9d895ea7b0432e518/href</a></iframe><h4>Data Preposeccsing</h4><pre>#import the pandas module<br>import pandas as pd<br>#load the data<br>df = pd.read_csv(‘data/Absenteeism-data.csv’)<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/986/1*Yt8lO_umThvjqi1nGsXnMg.png" /><figcaption>Absenteeism from work dataset</figcaption></figure><pre>df.info()<br>&lt;class &#39;pandas.core.frame.DataFrame&#39;&gt;<br>RangeIndex: 700 entries, 0 to 699<br>Data columns (total 12 columns):<br>ID                           700 non-null int64<br>Reason for Absence           700 non-null int64<br>Date                         700 non-null object<br>Transportation Expense       700 non-null int64<br>Distance to Work             700 non-null int64<br>Age                          700 non-null int64<br>Daily Work Load Average      700 non-null float64<br>Body Mass Index              700 non-null int64<br>Education                    700 non-null int64<br>Children                     700 non-null int64<br>Pets                         700 non-null int64<br>Absenteeism Time in Hours    700 non-null int64<br>dtypes: float64(1), int64(10), object(1)<br>memory usage: 65.7+ KB</pre><ul><li><strong>The ID </strong>is the individual identification for each person and doesn’t have any numeric information. The Id column does not have any value for predicting the absenteeism hour from the work. So, we can drop the ID column from the data frame.</li></ul><pre>df = df.drop([&#39;ID&#39;], axis = 1)</pre><ul><li><strong>The Reason for Absence:</strong></li></ul><pre>#Let’s extract a list containing distinct values from reason for absence<br>df[‘Reason for Absence’].unique()</pre><pre>array([26,  0, 23,  7, 22, 19,  1, 11, 14, 21, 10, 13, 28, 18, 25, 24,  6, 27, 17,  8, 12,  5,  9, 15,  4,  3,  2, 16])</pre><p>How can we extract some meaning from these numeric values? Similarly to the case of the ID column, the values here do not actually have a numeric meaning they represent categories that are equally meaningful. So, we can turn these values into dummy variables which are an explanatory binary variable that equals 1 if a certain categorical effect is present and equals 0 is not.</p><pre>reason_columns =pd.get_dummies(df[&#39;Reason for Absence&#39;])<br>reason_columns.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*zXeMia61UMGzqQ_2pPldYw.png" /></figure><p>If we add all these dummy variables in the df data frame we would end up with a dataset containing nearly 40 columns. So, we could reorganize a certain type of variables into groups</p><ul><li>Group 1: Related to various diseases.</li><li>Group 2: Related to pregnancy and giving birth.</li><li>Group 3: Related to poisoning or signs not elsewhere categorized.</li><li>Group 4: Represents light reasons for absence such as a dental appointment physiotherapy a medical consultation and other.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*td8NbBOeFyJQ91L_vkBA3w.png" /><figcaption>Grouping the reason for an absence</figcaption></figure><pre>#max() function here  substitute an entire row in new single one column<br>reason_type_1 = reason_columns.loc[:, 1:14].max(axis=1)<br>reason_type_2 = reason_columns.loc[:, 15:17].max(axis=1)<br>reason_type_3 = reason_columns.loc[:, 18:21].max(axis=1)<br>reason_type_4 = reason_columns.loc[:, 22:].max(axis=1)   ## from 22 to end of data frame</pre><pre>#Let’s concant all reason’s<br>df_reason = pd.concat([reason_type_1, reason_type_2,reason_type_3,reason_type_4], axis=1)<br>#create the varible with column name<br>reason_column_name = [‘Reason_1’,’Reason_2&#39;,’Reason_3&#39;, ‘Reason_4’]<br>#Rename the column<br>df_reason.columns = reason_column_name<br>df_reason.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*FGDwE0A-uojvddMBib_Nuw.png" /></figure><p>We still have the reason for absence column in df. We need to add all those dummy variables to our current df. But, we could observe duplicate information calling multicore linearity which is something we should be avoided in general. Therefore in our case, we could drop the reason for absence column from the df data frame. Then concatenate the data frames.</p><pre>df  = df.drop([&#39;Reason for Absence&#39;], axis = 1)<br>df = pd.concat([df_reason, df], axis=1)</pre><ul><li><strong>Date</strong> values have been stored as text what we will do now is introduce a data type called timestamp. We will convert the strings from the date column into timestamps with the help of the format parameter.</li></ul><pre>df[&#39;Date&#39;] =pd.to_datetime(df[&#39;Date&#39;], format=&#39;%d/%m/%Y&#39;)</pre><p>We will create the<strong> Month Value</strong> and <strong>Day of the Week</strong> column from the Date column.</p><pre>list_months =[]<br>for i in range(df.shape[0]):   #df.shape[0] takes the row from the df dataframe<br>    list_months.append(df[&#39;Date&#39;][i].month)<br>df[&#39;Month Value&#39;] =list_months</pre><pre>#then we create the function to implement it to all values from the column of interest.<br>def date_to_week(data_value):<br>    return data_value.weekday()<br>df[&#39;Day of the Week&#39;] = df[&#39;Date&#39;].apply(date_to_week)<br>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*a37DrCu7SJx8V5GrN_20sg.png" /></figure><ul><li>Education column contains only the values 1, 2, 3, and 4. <br>1: higher degree <br>2: graduate<br>3: postgraduate<br>4: master or a doctor</li></ul><p>Let’s use panda’s value_counts method to see the values from the education column how may times countered.</p><pre>df[&#39;Education&#39;].value_counts()<br>1    583<br>3     73<br>2     40<br>4      4<br>Name: Education, dtype: int64</pre><p>We can see that nearly 600 people from high school education only while just above one hundred have a better degree than that. Therefore separating between graduate postgraduate and doctor degrees becomes less relevant for this study and it would make sense to combine these in a single category.</p><p>1 -&gt; 0 higher degree <br>2 -&gt; 1 graduate<br>3 -&gt; 1 postgraduate<br>4 - &gt;1 master ora doctor</p><pre>df[&#39;Education&#39;] = df[&#39;Education&#39;].map({1:0, 2:1, 3:1, 4:1})<br>df[&#39;Education&#39;].unique()<br> array([0, 1])</pre><pre>df[&#39;Education&#39;].value_counts()<br> 0    583<br> 1    117<br> Name: Education, dtype: int64</pre><p>The transportation expense, distance to work, age, daily work Load, body mass index columns won’t manipulate in any way. They will be left without a change.</p><p>As the last step, we should save our preprocessed file into .csv for machine learning study.</p><pre>df_preprocessed.to_csv(‘data/absenteeism_preprocessed.csv’, index=False)</pre><h4>Final Thought</h4><p>You may find this study in the<a href="https://www.udemy.com/python-sql-tableau-integrating-python-sql-and-tableau/learn/v4/overview"> Udemy course</a> with more detail and also check my<a href="https://github.com/aysbt/DataScienceCourse"> githup</a> for preprocessing part.</p><p>I have written this article to improve my data analytic skills so I am still a learner. Please let me know any additional information or comment on this article.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F12js4kjVoX8Chq%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F12js4kjVoX8Chq%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F12js4kjVoX8Chq%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea56fbf7c99bc2989ebffffb17366816/href">https://medium.com/media/ea56fbf7c99bc2989ebffffb17366816/href</a></iframe><p>Follow me on<a href="https://twitter.com/aaysbt"> Twitter</a>, <a href="http://linkedin/">Linkedin</a> or in <a href="https://medium.com/@aaysbt">Medium.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f311c937d765" width="1" height="1" alt=""><hr><p><a href="https://medium.com/my-data-camp-journey/preprocessing-data-for-logistic-regression-f311c937d765">Preprocessing Data for Logistic Regression</a> was originally published in <a href="https://medium.com/my-data-camp-journey">My Data Science Journey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Investigating TMDB Movie Datasets]]></title>
            <link>https://medium.com/my-data-camp-journey/investigating-tmdb-movie-datasets-4ee04c263915?source=rss----e1c34035004e---4</link>
            <guid isPermaLink="false">https://medium.com/p/4ee04c263915</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[tmdb]]></category>
            <category><![CDATA[data-analyst]]></category>
            <dc:creator><![CDATA[Ayşe Bat]]></dc:creator>
            <pubDate>Fri, 22 Feb 2019 16:42:27 GMT</pubDate>
            <atom:updated>2019-02-22T16:42:34.600Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y1D9OyNtARhP0jrVmvULTw.jpeg" /></figure><h4>In this story, I will investigate the TMDB movies dataset which is collected between 1960 to 2015 with the information of title, budget, revenue, cast, director, genres, release date, release year, runtime, etc …</h4><p>The primary goal of the project is making the exploratory data analysis using numpy, pandas, seaborn and matplotlib library. For this, we need the clean the data first. Previously, we should ask a question and find the answers inside this datasets. So, this purpose will help us with the cleaning process.</p><blockquote>The original data source comes from <a href="https://www.kaggle.com/juzershakir/tmdb-movies-dataset/home">Kaggle</a></blockquote><h4>Questions to be Answered</h4><blockquote><strong>What are all times highest and lowest profit movie?</strong></blockquote><blockquote><strong>What is all times top 10 movies which earn the highest profit?</strong></blockquote><blockquote><strong>What are the highest profit movie and the total profit for each year?</strong></blockquote><blockquote><strong>What is the all times highest and lowest budget movie?</strong></blockquote><blockquote><strong>What is all times top 10 movies which have the highest budget?</strong></blockquote><blockquote><strong>What are the highest budget movie and the total budget for each year?</strong></blockquote><blockquote><strong>What is the All times highest and lowest revenue movie?</strong></blockquote><blockquote><strong>What is all times top 10 movies which have the highest revenue?</strong></blockquote><blockquote><strong>What are the highest budget movie and the total budget for each year?</strong></blockquote><blockquote><strong>Which genres most used from 1960 to 2015?</strong></blockquote><blockquote><strong>Which cast were more filmed?</strong></blockquote><blockquote><strong>Which director was most filmed?</strong></blockquote><blockquote><strong>What is the Number of movies released in each month? What is the total profit by month?</strong></blockquote><h4>Importing the Libraries</h4><pre><strong>import</strong> <strong>pandas</strong> <strong>as</strong> <strong>pd</strong><br><strong>import</strong> <strong>numpy</strong> <strong>as</strong> <strong>np</strong><br><strong>import</strong> <strong>seaborn</strong> <strong>as</strong> <strong>sns</strong><br><strong>import</strong> <strong>matplotlib.pyplot</strong> <strong>as</strong> <strong>plt</strong><br>sns.set()</pre><h4>Loading the datasets</h4><p>Githup repositories for this project is <a href="https://github.com/aysbt/Data_Cleaning">here.</a></p><pre>df = pd.read_csv(&#39;data/tmdb_movies_data.csv&#39;)<br>#Let&#39;s check the dataset information<br>df.info()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*_Ni_NqiKjG4yPIh5d5wyrg.png" /></figure><p>There are 10866 columns and 21 columns.</p><ul><li>“id”, “imdb_id” columns are similar column so we can get rid of “imdb_id” column which is not given any useful information for this analysis.</li><li>“popularity”, “budget”, and “revenue” columns are useful for this analysis and we are going to calculate the profit extract the revenue from the budget column. But previously we need the handle the missing values from budget and revenue column.</li><li>“original_title”, “cast”, “director” columns have useful information about the movies.</li><li>“homepage”, “tagline”, “keywords”, “overview”, “vote_average”, “budget_adj”, “revenue_adj” columns are not useful for analysis so these columns could be deleted from the data frame.</li><li>“release_date”, and “release_year” columns also important. And we need the convert the release_date column to pandas DateTime object.</li></ul><h4>Data Cleaning</h4><ul><li>Drop the duplicated rows.</li><li>Replace the values from ‘0’ to ‘NAN’ then, drop the rows which have missing values.</li><li>Change the format of release date into DateTime format.</li><li>Delete the unused columns from Data Frame</li><li>Checking the all columns are in the desired data type.</li><li>Calculating the profit extracting revenue from the budget.</li></ul><pre>#’duplicated()’ function return the duplicate row as True and othter as False<br># using the sum() functions we can count the duplicate elements <br>sum(df.duplicated())</pre><pre>#Let&#39;s drop these row using &#39;drop_duplicates()&#39; function<br>df.drop_duplicates(inplace=True)</pre><pre>#Changing Format Of Release Date Into Datetime Format<br>df[&#39;release_date&#39;] = pd.to_datetime(df[&#39;release_date&#39;])</pre><pre>df[[&#39;budget&#39;,&#39;revenue&#39;]] = df[[&#39;budget&#39;,&#39;revenue&#39;]].replace(0,np.NAN)<br>df.dropna(subset=[&#39;budget&#39;, &#39;revenue&#39;], inplace=<strong>True</strong>)</pre><pre>del_col = [&#39;imdb_id&#39;, &#39;homepage&#39;,&#39;tagline&#39;, &#39;keywords&#39;, &#39;overview&#39;,&#39;vote_average&#39;, &#39;budget_adj&#39;,&#39;revenue_adj&#39;]<br>df.drop(del_col, axis=1, inplace=<strong>True</strong>)</pre><pre><em>#Before answering the questions, lets figure out the profits of each movie</em><br>df[&#39;profit&#39;] = df[&#39;revenue&#39;]-df[&#39;budget&#39;]<br>df[&#39;profit&#39;] = df[&#39;profit&#39;].apply(np.int64)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*0Aw-SP4LENps_1kRbHMyEw.png" /><figcaption>The columns have the null values and type of the columns</figcaption></figure><h3>Exploratory Data Analysis</h3><p>We will create the function to facilitate the answer the questions before going into exploratory data analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*B17BJn5PvuDhpzN5M2gtZg.png" /></figure><p>This function is to find out the min and the max value of any given column. So, we can use this function on the budget, revenue, and profit to find out the highest and lowest values for given information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*4MNCR-cO58NPtmreUe0yDA.png" /></figure><p>The top_10 function calculates all times top 10 movies for any given columns, and also plot this information in a bar chart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*aRPEWbx-WUsncIxSyTiuTA.png" /><figcaption>function to the highest value of a given column for last 15 movies</figcaption></figure><p>If we want to find out the total or highest value of any given column (budget, revenue, or profit) for each year separately then we could use the each_year_best function which is defined below. This function will plot the total and highest value of any given column for the last 15 years as default.</p><blockquote>Using these functions on the budget, revenue, and profit columns let’s find out the answers we are looking for.</blockquote><h3>What are all times highest and lowest profit movie?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*GxInAQP3RmL1lClT2DAExQ.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FAxhxIcTMEMqR2%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FAxhxIcTMEMqR2%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FAxhxIcTMEMqR2%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="240" frameborder="0" scrolling="no"><a href="https://medium.com/media/aa290ce313305a3f965a2909e4e51093/href">https://medium.com/media/aa290ce313305a3f965a2909e4e51093/href</a></iframe><h3>What is all times top 10 movies which earn the highest profit?</h3><pre>top_10(&#39;profit)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*lMe-cOTqxqJlj6UZTTWGdA.png" /></figure><h3>What are the highest profit movie and the total profit for each year?</h3><pre>each_year_best(&#39;profit&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*o1ESmuQVXfyfp7QtUpYY-g.png" /></figure><h3>What is the all times highest and lowest budget movie?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*QhlH0GVPQ0ZYof8JPVyH-A.png" /></figure><p>Yeap, you see correct the highest budget movie is the warrior’s way. This movie also has the lowest profit. That reason you probably didn’t hear the movie… 😢</p><h3>What is all times top 10 movies which have the highest budget?</h3><pre>top_10(&#39;budget&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*WmGh-prO-8EBBGkXuIsLaw.png" /></figure><h3>What are the highest budget movie and the total budget for each year?</h3><pre>each_year_best(&#39;budget&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*dwNQcj7TId9e0X7WwDjfyw.png" /></figure><h3>What is the All times highest and lowest revenue movie?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*mPDTbrf_GGqkZSUUbRcWJg.png" /></figure><h3>What is all times top 10 movies which have the highest revenue?</h3><pre>top_10(&#39;revenue&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*oqAnlHjBooIRBugU4p1qLw.png" /></figure><h3>What are the highest budget movie and the total budget for each year?</h3><pre>each_year_best(&#39;revenue&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*yHrPSAzLbxJj9LHbM3V1Rw.png" /></figure><p>We are going to write another function to answer the following question. This function could take the column like genres, cast or director then count the values of these columns to find out more filmed genres or the cast or director more filmed in this time of period.</p><p>We are going to write a function to find out the most filmed genres, cast or director.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*jr-UUnmuxTEPnNkB3oyNAg.png" /></figure><p>The splint_count_data function takes a column with the information which we want to count and find out the most being one in a given column then make it bar plot and pie chart with the percentage.</p><h3>Which genres was more used from 1960 to 2015?</h3><pre>split_count_data(‘genres’)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZAjO_WI5KUHCzfUqJN6GGQ.png" /></figure><h3>Which cast were more filmed?</h3><pre>split_count_data(‘cast’,size=25)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXifYdiinL4XAIRYCtWuQg.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FcCaLV8fuGnp45VBdG7%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FcCaLV8fuGnp45VBdG7%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FcCaLV8fuGnp45VBdG7%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/080a909377e1239d90782362da312f67/href">https://medium.com/media/080a909377e1239d90782362da312f67/href</a></iframe><h3>Which director was most filmed?</h3><pre>split_count_data(‘director’)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*vQYYyGlw022IcCwTLYGFmg.png" /></figure><h3>Which production companies were the most filmed?</h3><pre>split_count_data(&#39;production_companies&#39;, size=20)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXetss1q--tjWkynpnvy3Q.png" /></figure><h3>What is the Number of movies released in each month? What is the total profit by month?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*n6UalJEMNYTevt41m85hKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*eJSd40q9Fg3vgOK9IK4RPw.png" /></figure><p>We also look for popularity and vote count column using the top_10 function to see the most popular film and most counted film.</p><p>Let’s explore the popularity using the top_10 function, and the also investigate the vote_count to find out most voted movies in TMDB website.</p><pre>top_10(‘popularity’, size=30)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*IlP2zrOgKCoCdPj7L_X_xw.png" /></figure><pre>top_10(‘vote_count’, size=30)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*_u-o-O3OwF9V-2vkHQBaig.png" /></figure><p>Let’s try the found out if there is any correlation between this variable.</p><pre>df_related = df[[&#39;profit&#39;,&#39;budget&#39;,&#39;revenue&#39;,&#39;runtime&#39;, &#39;vote_count&#39;,&#39;popularity&#39;,&#39;release_year&#39;]]<br>sns.pairplot(df_related, kind=&#39;reg&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tXth09_SPEVPXUwJKjVaAg.png" /></figure><p>Let’s check out a few plots below:</p><ul><li><strong>1. Budget vs Revenue:</strong> Budget and revenue both have a <strong>positive correlation</strong> between them. Means there is a good possibility that movies with higher investments result in better revenues.</li><li><strong>2. Profit Vs Budget: </strong>Profit And Budget both have a <strong>positive correlation</strong> between them. Means there is a good possibility that movies with higher investments result in better profit.</li><li><strong>3. Release Year Vs Vote count: </strong>Release year and vote Average have a <strong>negative correlation</strong>. Means that movie ratings (vote count) do not depend on the release year.</li><li><strong>4. Popularity Vs Profit: </strong>Popularity and profit have a <strong>positive correlation</strong>. It means that movie with high popularity tends to earn high profit.</li></ul><h3>Conclusion</h3><p>We analysis the TMDB dataset which is collected between 1960 to 2015. Our goal here finding the answer utilizing this dataset. We could summaries this analysis result in the following items.<br>1- The most profitable movie is Avatar and filmed in 2009. Star Wars: The Force Awakers is second, and Titanic is the third one.<br>2- The last profitable movie is The Warrior’s Way and this movie also has the highest budget.<br>3- The most popular genres was filmed Drama, Comedy, and Action.<br>4- The most filmed actor was Robert De Niro, Bruce Wills and Samual L. Jackson.<br>5- The most filmed director was Steven Spielberg, Clint Eastwood, and Ridley Scott.<br>6- The most filmed production company was Universal Pictures, Waner Bros, and Paramount Pictures.<br>7- The most profitable mounts are June, December, and May.<br>8-According to TMDB dataset, all times most popular movies are Jurassic World, Mad Max: Fury Road, and Interstellar.<br>9-All times most voted movies are Inception, The Avengers and Avatar.<br>10- Revenue and budget both have a positive correlation between them.<br>11- There is a high probability that movies with higher investments result in better profit.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F4EF5xIO5yiivWh4gGn%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F4EF5xIO5yiivWh4gGn%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F4EF5xIO5yiivWh4gGn%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/c81b65341fd33841d2212646b54536c9/href">https://medium.com/media/c81b65341fd33841d2212646b54536c9/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ee04c263915" width="1" height="1" alt=""><hr><p><a href="https://medium.com/my-data-camp-journey/investigating-tmdb-movie-datasets-4ee04c263915">Investigating TMDB Movie Datasets</a> was originally published in <a href="https://medium.com/my-data-camp-journey">My Data Science Journey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Data Camp Journey]]></title>
            <link>https://medium.com/my-data-camp-journey/my-data-camp-journey-537fd43b8e8?source=rss----e1c34035004e---4</link>
            <guid isPermaLink="false">https://medium.com/p/537fd43b8e8</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[datacamp]]></category>
            <category><![CDATA[data-science-skills]]></category>
            <dc:creator><![CDATA[Ayşe Bat]]></dc:creator>
            <pubDate>Thu, 14 Feb 2019 17:30:40 GMT</pubDate>
            <atom:updated>2019-02-14T17:30:39.942Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xAoBoZ1EEFsDqv7K4Zac6Q.png" /></figure><p>You probably heard that the data scientist labeled as “<em>sexiest job of the 21st century</em>” from Harvard University. If you heard, there is also a high probability that you heard the <a href="https://www.datacamp.com/courses/all">Datacamp</a> name or even you get their free courses. At least that what I found when I search the data science courses. <a href="https://www.datacamp.com/courses/all">Data camp</a> was one of the professional platforms that cover all courses that I want to take it 👌. And in this post, I will mention the datacamp courses, advantages, disadvantages, and so on…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FnGMnDqebzDcfm%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FnGMnDqebzDcfm%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FnGMnDqebzDcfm%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="431" frameborder="0" scrolling="no"><a href="https://medium.com/media/b854b4c60b2ae7114d03074e7222a380/href">https://medium.com/media/b854b4c60b2ae7114d03074e7222a380/href</a></iframe><blockquote>“<a href="https://www.datacamp.com/courses/all">DataCamp</a> offers interactive R, Python, Sheets, SQL and shell courses. All on topics in data science, statistics and machine learning. Learn from a team of expert teachers in the comfort of your browser with video lessons and fun coding challenges and projects.”</blockquote><p>I enroll the <a href="https://www.datacamp.com/tracks/data-scientist-with-python">Data science track with python</a>, which is 84 hours, and 22 courses in total. It covers the following courses.</p><p><a href="https://www.datacamp.com/courses/intro-to-python-for-data-science">Introduction to </a>Python, <a href="https://www.datacamp.com/courses/intermediate-python-for-data-science">Intermediate Python for Data Scienc</a>e, <a href="https://www.datacamp.com/courses/python-data-science-toolbox-part-1">Python Data Science Toolbox (Part 1)</a>&amp;<a href="https://www.datacamp.com/courses/python-data-science-toolbox-part-2">(Part 2)</a>, <a href="https://www.datacamp.com/courses/importing-data-in-python-part-1">Importing Data in Python (Part 1)</a> &amp; <a href="https://www.datacamp.com/courses/importing-data-in-python-part-2">(Part 2)</a>, <a href="https://www.datacamp.com/courses/cleaning-data-in-python">Cleaning Data in Python</a>, <a href="https://www.datacamp.com/courses/pandas-foundations">pandas Foundations</a>,<a href="https://www.datacamp.com/courses/manipulating-dataframes-with-pandas"> Manipulating DataFrames with pandas</a>, <a href="https://www.datacamp.com/courses/merging-dataframes-with-pandas">Merging DataFrames with pandas</a>, <a href="http://Intro to SQL for Data Science">Intro to SQL for Data Science</a>,<a href="https://www.datacamp.com/courses/introduction-to-relational-databases-in-python"> Introduction to Databases in Python</a>, <a href="https://www.datacamp.com/courses/introduction-to-data-visualization-with-python">Introduction to Data Visualization with Python</a>, <a href="https://www.datacamp.com/courses/interactive-data-visualization-with-bokeh">Interactive Data Visualization with Bokeh</a>, <a href="https://www.datacamp.com/courses/statistical-thinking-in-python-part-1">Statistical Thinking in Python (Part 1)</a> &amp; (<a href="https://www.datacamp.com/courses/statistical-thinking-in-python-part-2">Part 2</a>), <a href="https://www.datacamp.com/courses/joining-data-in-postgresql">Joining Data in SQL</a>, <a href="https://www.datacamp.com/courses/supervised-learning-with-scikit-learn">Supervised Learning with scikit-learn</a>, <a href="https://www.datacamp.com/courses/machine-learning-with-the-experts-school-budgets">Machine Learning with the Experts: School Budgets</a>, <a href="https://www.datacamp.com/courses/unsupervised-learning-in-python">Unsupervised Learning in Python</a>, <a href="https://www.datacamp.com/courses/deep-learning-in-python">Deep Learning in Python</a>, <a href="https://www.datacamp.com/courses/network-analysis-in-python-part-1">Network Analysis in Python (Part 1)</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FFPbnShq1h1IS5FQyPD%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FFPbnShq1h1IS5FQyPD%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FFPbnShq1h1IS5FQyPD%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/a7522b65366d91070383aa30622733c3/href">https://medium.com/media/a7522b65366d91070383aa30622733c3/href</a></iframe><p><strong>What do I like about the datacamp?</strong><br><em>1- There are very well-designed practice sections after the video content.<br>2- Topic explains from a different expert that they are professional data scientist working at industry or in the universities.<br>3- Topic content start with basic ideas and then evolving so, it helps the understanding process especially for the machine learning part.<br>4- There are a lot of additional courses apart from career track or skill track.<br>5-There are also course covered case studies especially for the machine learning part.<br>6- They are continuing to adding new courses.<br>7- There are datasets for every course that you can make practice own your own.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3osxY9kuM2NGUfvThe%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3osxY9kuM2NGUfvThe%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3osxY9kuM2NGUfvThe%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/7785af82a97454d5ca70105b5bb13c70/href">https://medium.com/media/7785af82a97454d5ca70105b5bb13c70/href</a></iframe><p><strong>What I don’t like about the datacamp?</strong><br><em>1- R programming courses more than python programming courses. 😒<br>2- Sometimes the provided datasets are different than in the videos or the practice part. So, you can see the different result or you may need additional effort on the datasets the bring the same result. <br>3- Even if all technical part well-covered but I think I need more practice to be more efficient. For example, in the data cleaning part I got every technical detail but if I got a really messy dataset I am not sure how to handle the data. <br>4- I understand the idea of data science part by part. I think there are not good at putting the piece of information together to going through the whole process. Like, How I connect the SQL and Python?</em></p><p><strong>What do I differently if just start the course?</strong><br><em>At the beginning of the course I want to reach the machine learning part so, I did faster the first part of the course and I didn’t practice using the provided-datasets. Using the datasets and going through all process by oneself it improving a lot. Before jump into the next course, I should probably make more practice by myself.</em></p><p><strong>Did it worth it? Should you take the course?</strong><br><em>It is totally worth it… I paid the $99 for a year (there was a deal) and I even did not complete my year yet. I believe it is good to start your data science journey. You can try their free courses it could help decide what should you take the course or not. I totally tump up for the datacamp. Happy Coding everyone.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJd8nZ3xwSkKP9NBnyuP4A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=537fd43b8e8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/my-data-camp-journey/my-data-camp-journey-537fd43b8e8">My Data Camp Journey</a> was originally published in <a href="https://medium.com/my-data-camp-journey">My Data Science Journey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>