<?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 Ashbab khan on Medium]]></title>
        <description><![CDATA[Stories by Ashbab khan on Medium]]></description>
        <link>https://medium.com/@ashbabkhan12?source=rss-4b5fa6a0933c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4NGeHKXRE6NIEI4zrP5wXw.jpeg</url>
            <title>Stories by Ashbab khan on Medium</title>
            <link>https://medium.com/@ashbabkhan12?source=rss-4b5fa6a0933c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 12:28:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ashbabkhan12/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[A Great Overview of Machine Learning Operations and How the MLFlow Project Made It Easy (Step By…]]></title>
            <link>https://pub.towardsai.net/a-great-overview-of-machine-learning-operations-and-how-the-mlflow-project-made-it-easy-step-by-a49585a4863c?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a49585a4863c</guid>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Sun, 05 Mar 2023 12:25:45 GMT</pubDate>
            <atom:updated>2023-03-09T13:05:14.227Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Great Overview of Machine Learning Operations and How the MLFlow Project Made It Easy (Step By Step)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pnxca5Vy3sW5_xxc" /><figcaption>Photo by <a href="https://unsplash.com/@donramxn?utm_source=medium&amp;utm_medium=referral">Ramón Salinero</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>development is a most important concept whether we talk about human evolution from hunter-gatherer to the modern human we see today. The same concept applies to the technologies such as Artificial Intelligence.</p><p>In the past, our focus is how to use Machine Learning to solve a problem, and almost a single person is handling all of the things, but today we see that the work is now divided. We now need a Data Scientist, Machine Learning Engineer, and Data Engineer due to the advancement in Technology.</p><p>Today making a production model is a challenging task, and we need to understand how we made it possible through Machine Learning Operations skills so in this article we are getting familiar with MLOps and MlFlow let’s get started.</p><h3>What is MLOps in simple terms</h3><p>𝐌𝐋𝐎𝐩𝐬 in simple terms, is the operation skills on how to make your model into production, which will be retrained and effectively tracked</p><p>such as which experiment generates the highest accuracy model or the Lowest accuracy model is based on summary metrics upload, and we can easily see the type of hyperparameters used in the highest and lowest score model.</p><p>We can easily trace the experiment author and when it is created what is the output artifact of the component such as a pre-process component generating preprocessed data and what are the summary metrics created such as the accuracy or roc_score, etc.</p><h3>How an end-to-end Machine Learning Pipeline in MLOps works.</h3><p>Developing an ML model for production is a challenging task it requires a lot of different skill sets other than making a machine learning model because a model is useless if it can’t make it to production.</p><p>Machine Learning Operations Engineering is one of them that helps us do this tough job in less time and with fewer resources.<br>According to experts, almost 50 to 90% of the model doesn’t make it into production, and that’s the scariest part.</p><p><strong>Let’s see a simple ETL Pipeline<br></strong>In the image, the blue one is a component, and the orange one is an artifact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*YmKHYCBxae4sMNJiG5LyQg.jpeg" /><figcaption>Source: Image by the author ( ashbab khan )</figcaption></figure><p>A component is a group of programming files that perform some task, whereas the artifact is the file or a directory produced by the component</p><p>for example:- see the above image. We have 6 components from download data to evaluation, and every component at least has three important files. After the component finishes running it will generate some files.</p><p>For example, the download component will take the Url of the data and give us a raw data file which we upload as an artifact to the platform, such as Weights and Biases.</p><p>the same process is done in the preprocessing component where it takes the previously created raw data as input and then performs preprocessing and again generates new data which is preprocessed data, and we again save it back to Weights and Biases and the same things happen with other components.</p><p>the one thing you might notice is that we are generating lots of data because every component in a pipeline needs different data so our data must be stored at the location so that any of your other teams who is residing anywhere also get access to the data.</p><p>As we discussed earlier artifact is a file or a directory of files generated by the different components, but most importantly artifact can be versioned. It means whenever we are making some changes in the component, or maybe new data is added to the source and running the component again creates a new version of the artifact.</p><p>as we see in the below image sample.csv is our artifact, and below there is a version of that artifact.</p><p>various tools and packages are used to store and fetch those artifacts one of the tools is Weights and Biases we can also use some other tools like Neptune, Comet, Paperspace, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OsJFWsTvKTqRlrtXSacXsw.png" /><figcaption>“Images of run and artifacts we see the 4 runsJob Type with a tag finished it means that the runs finish works and produce the respective output which we can see after clicking on the run and then clicking on the overview tab which is located at first and we can also see our artifact section which is located at last tab on clicking the artifact section we see our artifacts so that’s where we see our first artifact Raw data and all the artifact is stored here”. Image source: Image by author</figcaption></figure><p><strong>Let’s take a brief introduction on how these tools or packages like Weights and Biases, also known as wandb used in MlOps:</strong></p><ul><li>This will be used to store and fetch artifacts</li><li>We can store many configurations to it, like the hyperparameters used in the model, and also store the images like feature importance, roc curve or correlation, etc.</li><li>Every time we fetch or store artifacts or, in simple terms, when we initialize the wandb we are creating a run. A run is an experiment that stores our configuration file, images, and basics info like who created this run and when and what is the input artifact it used and what is the output artifact it produced in the above image we see our run and artifacts.</li></ul><p><strong>See the ETL pipeline image. We have two components above:</strong></p><ul><li>download data</li><li>preprocessing</li></ul><p>When we run the ETL pipeline, what happens is that it passed the URL to our download data component, and it generates a file called raw_data (artifact) which we store in the weight and biases.</p><p>Then in the preprocessing component, we fetch this raw_data file from weight and biases and then preprocess this data and then store it as new data, which is clean_data.csv and upload it to weight and biases as an artifact, this is how we store and fetch different files and directories from anywhere using weights and biases.</p><p>See the image of End to End ML pipeline. We see a lot of components such as download_data, preprocessing, checking_data, etc. the work of this pipeline is the same as we see in ETL the download_data generates an artifact, and then that artifact is used by preprocessing component, and so on</p><p>in the end, the random_forest component will generate our model, which is an inference artifact that is ready to predict the target value of unknown observations.</p><p>So now our inference artifact is ready for production, and as we discussed earlier, that artifact can be versioned, so let’s say we generated 2 versions from v0 and v1 and we decided to use the v1 for production then we marked this artifact as prod means ready for production.</p><p>then we upload our project to GitHub so that other developers have access to this code, and the rest of the process is handled by software engineers and DevOps engineers that how it will be integrating the model with the software.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AytVTwyzGa3LGoC02U9URQ.png" /><figcaption>“We see that we marked the v1 as a prod tag because this version is ready for production and we can change this anytime”. Image source: Image by author</figcaption></figure><h3>Problem due to model to drift and how to solve it</h3><p>As we are all familiar with that a model needs updated data for the best performance otherwise it will cause <strong>model drift.</strong></p><p>It is very<strong> </strong>important to continuously update the data and re-train our model to avoid model drift, so there might be questions about how we will do this in MlOps, and the answer is simple.</p><p>let’s say our source data is updated with new data, and we want to re-train our model with that new data, so we have to run our pipeline again this will run all the components again with the new data passed in the download data component, and so on.</p><p>when our inference pipeline run again with the newly added data, it will generate a new version v2 inference artifact and then we have to unmark the v1 from prod that we marked previously and mark the latest version v2 as a prod, and that’s it our new inference artifact is ready for production again.</p><p>But this is not a simple task we have to do a lot of experiments and create a lot of versions of the artifact, and the best-performing artifact is marked as production so that any person easily identifies that this version of the artifact is going to be used in production.</p><h3>What is MLFlow and how MLFlow used in MLOps to run our end-to-end machine learning pipeline in production?</h3><p>MLFlow is a Framework that is used to run our Machine Learning Pipeline through the effective workflow using a simple command.</p><pre>mlflow run .</pre><pre>mlflow run src/download_data</pre><p>through MlFlow we can chain all the components that we have seen previously so that it can execute all the components in the right flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uaC3n8dcC9NpTWUYX3glYg.png" /><figcaption>“Three important files of a MlFlow project”. Source: Image by author</figcaption></figure><p><strong>The MlFlow project is divided into three parts:</strong></p><ul><li>𝐄𝐧𝐯𝐢𝐫𝐨𝐧𝐦𝐞𝐧𝐭 (𝐝𝐞𝐩𝐞𝐧𝐝𝐞𝐧𝐜𝐢𝐞𝐬)</li><li>𝐂𝐨𝐝𝐞</li><li>𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝐃𝐞𝐟𝐢𝐧𝐢𝐭𝐢𝐨𝐧</li></ul><p><strong>Let’s understand them one by one</strong></p><p>𝐄𝐧𝐯𝐢𝐫𝐨𝐧𝐦𝐞𝐧𝐭: the first one is the environment file means the packages that are used in a code, such as pandas, MlFlow, and, seaborn these all are packages required in a data science project so below is our environment file.</p><p>we see that component is the name of this environment file, and then we have the dependencies section these are the packages that we are downloading from the two channels the first one is conda forge if it is can’t able to find any packages in conda forge.</p><p>then it will look in the defaults channel to download and install the file, and we can also download and install packages from pip as we do for wandb.</p><h3><strong>Important note</strong></h3><p>if we are downloading a specific version of packages from the channel as we do below, like <strong>mlflow=2.0.1</strong> we have to use only one = sign, and if we are downloading specific version packages from pip we have to use == sign like we do <strong>wandb==0.13.9</strong>.</p><pre>name: components<br>channels:<br>  - conda-forge<br>  - defaults<br>dependencies:<br>  - mlflow=2.0.1<br>  - python=3.10.9<br>  - hydra-core<br>  - pip<br>  - pip:<br>      - wandb==0.13.9</pre><p>𝐂𝐨𝐝𝐞: Code is the actual logic which is our programming file.</p><p>𝐏𝐫𝐨𝐣𝐞𝐜𝐭 𝐝𝐞𝐟𝐢𝐧𝐢𝐭𝐢𝐨𝐧: MlFlow doesn’t run the coding file directly it first runs the project definition file which is an MLproject file in this file we write a code that how the code file is run and what arguments our code file needs.</p><p>Below we see our MLProject file the first thing that we understand is that in the <strong>conda_env </strong>we are<strong> </strong>using our environment file name as we see above in the environment section this will run our conda.yml file (the above environment file we see is saved as a conda.yml file).</p><p>this will install the necessary packages from channels and pip, then it runs the parameters section, and at the last, the command section will run our python file run.py with the necessary arguments that our python file needs.</p><h3>This is how the MlProject file looks like</h3><pre>name: download_file<br>conda_env: conda.yml<br><br>entry_points:<br>  main:<br>    parameters:<br>      artifact_name:<br>        description: Name for the output artifact<br>        type: str<br><br>      artifact_type:<br>        description: Type of the output artifact. This will be used to categorize the artifact in the W&amp;B<br>                     interface<br>        type: str<br><br>      artifact_description:<br>        description: A brief description of the output artifact<br>        type: str<br><br>    command: &gt;-<br>      python run.py --artifact_name {artifact_name} \<br>                    --artifact_type {artifact_type} \<br>                    --artifact_description {artifact_description}</pre><h3>So what are the above parameters, and where it is getting value from</h3><p>Let’s understand our first question what is this above parameter is</p><p>To create an artifact, we need these three parameters, and we store and fetch artifacts from the code file. That’s why we are passing these parameters to our code file from the MlProject file to avoid hard coding:</p><ul><li>artifact name</li><li>artifact type</li><li>artifact description</li></ul><h3>Passing value to a python file using cmd</h3><p>To receive an argument through cmd or MlProject to a python file, we have to use a package called argparse below is a demonstration of how Argparse works.</p><p>below is the code that we need to add in the python file __main__ section to receive arguments from cmd in our case, we are receiving 3 arguments from MlProject to our code file or python file.</p><ol><li>—artifact_name</li><li>— artifact_type</li><li>— artifact_description</li></ol><h3>Code file</h3><pre>if __name__ == &quot;__main__&quot;:<br>    parser = argparse.ArgumentParser(description=&quot;Download URL to a local destination&quot;)<br><br>    parser.add_argument(&quot;--artifact_name&quot;,<br>                         type=str,<br>                         help=&quot;Name for the output artifact&quot;,<br>                         required=True)<br><br>    parser.add_argument(&quot;--artifact_type&quot;,<br>                         type=str,<br>                         help=&quot;Output artifact type.&quot;,<br>                         required=True)<br><br>    parser.add_argument(&quot;--artifact_description&quot;,<br>                         type=str,<br>                         help=&quot;A brief description of this artifact&quot;,<br>                         required=True<br>    )<br><br>    args = parser.parse_args()</pre><p>see the MLproject file again that’s the same three arguments we are passing to the run.py file in the command section and that’s how we receive the same 3 arguments in python.</p><h3>Our second question is where the MlProject file getting value from</h3><p>As we discussed earlier that, whenever we run a MlFlow project, the first file will run is the MlProject file, and we use the above command in the terminal, which is <strong>mlflow run {file_path}. This</strong> command is used when we are passing nothing to our Mlproject file, but in our case, there are 3 parameters that this file needs, so we use a little bit different command.</p><p><strong>The below code is the practical demonstration of how we pass value to the MlProject file through cmd.</strong></p><pre>mlflow run . -P artifact_name=clean_data.csv \<br>             -P artifact_type=clean_data \<br>             -P artifact_description=&quot;Clean and preprocessed data&quot;   </pre><p>here in the above code, to pass a value to MlProject parameters through MlFlow we used the <strong>-P</strong> command and the parameters name as we did in the above code.</p><p>So that’s how MlFlow runs the components and how these three files code, environment, and MlProject work together thank you for reading this article.</p><p>you can connect with me on <a href="https://www.linkedin.com/in/ashbabkhan/">LinkedIn</a></p><p>till then if you have any questions regarding this post, feel free to ask in the comment section</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a49585a4863c" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/a-great-overview-of-machine-learning-operations-and-how-the-mlflow-project-made-it-easy-step-by-a49585a4863c">A Great Overview of Machine Learning Operations and How the MLFlow Project Made It Easy (Step By…</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to remove Nan or NULL values in data using python]]></title>
            <link>https://ashbabkhan12.medium.com/how-to-remove-nan-values-in-data-using-python-8f959e3d5fbc?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f959e3d5fbc</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Fri, 18 Nov 2022 04:05:14 GMT</pubDate>
            <atom:updated>2022-11-28T11:41:31.011Z</atom:updated>
            <content:encoded><![CDATA[<p>Removing Nan values is essential for data analysis.<br>Let’s see how we can remove Nan values from our data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lFwVKt31-Q9XVVPf2X8TFQ.png" /><figcaption>Source: Image by author</figcaption></figure><p>See image 1<br>We can see our data which contains three columns 1st and 2nd column are categorical and 3rd column is numerical.</p><p>We then used data.isna().sum() to give us which column contains how many Nan values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LPUA5vLoXUa5GL6HAq9RmA.png" /><figcaption>Source: image by the author</figcaption></figure><p>See image 2<br>If we want to sort the values from higher to lower, we use data.isna().sum().sort_values(ascending=False)</p><p>We also delete that rows contain Nan values using data.dropna().<br>It is not recommended to delete rows that contain Nan value, but it is good to know that we can also delete Nan rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MSNE_4FbUmL3E0J6xK5Fgw.png" /><figcaption>Source: Image by author</figcaption></figure><p>See image 3<br>We can also fill in Nan values with other values, such as 0, using data.fillna(0).</p><p>We see the basic syntax of how to handle Nan values. Let’s see how to fill Nan&#39;s values with more meaningful values.<br>So what is the meaning of meaningful values?</p><p>It is not the best option to replace the Nan value with some constant value, as we do in image 3.<br>If the column data type is numerical, then it is best to fill the Nan value with that column&#39;s mean or average value. In some other cases, we also use median and mode, but in most cases, we use mean and<br>If the column data type is an object, then it is best to use the most frequent value of that column.<br>So how do we do that? In this case, we use the Simpleimputer function to fill in a numerical column with the mean and an object column with the most frequent value.</p><p>So simpleimputer() takes an argument that is by default mean, but we set it to simpleimputer(strategy=”most_frequent”)<br>Using strategy = “most_frequent” we say that fill the column with the most frequent value.</p><p>Let’s see how we do that with the use of python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YF4X1anqiG7cUb2yGd1tgw.png" /><figcaption>Source: Image by author</figcaption></figure><p>See image 4<br>We imported SimpleImputer, which will be used to remove Nan values.</p><p>The first step we will take is to select a numerical column as we do in the second line of image four then we use the fit_transform method to fill Nan with mean values.<br>So our numerical column Nan values are now replaced with the mean value</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8uHsX1V1wjAtFY2z8R8tZQ.png" /><figcaption>Source: Image by author</figcaption></figure><p>See image 5<br>We do the same thing as before, but we pass strategy = “most_frequent” because our column is an object, so this will fill that two columns with the most frequent value of that column.<br>Now our Nan value is removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9RUPtxrNIwx7TsLd2CaLQ.png" /><figcaption>Source: Image by author</figcaption></figure><p>See image 6<br>Now add all the columns together, and that’s it. All our Nan values are now removed with some meaningful values.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f959e3d5fbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[4 Amazing SQL Queries for Data Science]]></title>
            <link>https://pub.towardsai.net/useful-intermediate-sql-queries-for-data-science-408c724b67d0?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/408c724b67d0</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Mon, 07 Nov 2022 05:20:51 GMT</pubDate>
            <atom:updated>2023-12-05T10:11:27.514Z</atom:updated>
            <content:encoded><![CDATA[<h4>SQL is the essential language for developers, Engineers, and Data professionals. Intermediate knowledge in SQL gives you an edge in your data science career.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CaggAi8cFuMRXd883vGkfw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@theshubhamdhage?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Shubham Dhage</a> on <a href="https://unsplash.com/s/photos/data-science?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>So in this post, we will discuss some of the essential intermediate SQL queries for data professionals. We will discuss 4 SQL queries, and the question is, why learn these 4 SQL queries?</p><p>We all are familiar with making a database in <strong>SQL, </strong>but more important is knowing how to clean and filter data effectively according to our needs. That&#39;s how these queries help us, so let&#39;s see what these queries are</p><ol><li><strong>Trigger in SQL, </strong>and how to use it in our query?</li><li><strong>Partition By</strong> in SQL</li><li><strong>Limit in SQL, </strong>and how do we use<strong> LIMIT </strong>syntax to limit our query in an SQL table?</li><li><strong>COALESCE function </strong>in the SQL, and how does it help us to get rid of <strong>NULL </strong>values?</li></ol><h3><strong>1. Trigger in SQL</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMki6yvi-qussqoKljfqKQ.png" /><figcaption>TRIGGER in SQL | Source: Image by author</figcaption></figure><p>In this post, we will talk about the power of <strong>triggers in SQL.</strong></p><p><strong>What is a Trigger in SQL?</strong></p><p>The trigger is an SQL code that runs automatically when an event is performed. for example: In the below query, our trigger runs when the user tries to Insert values in the table.</p><p>The trigger is mainly divided into three parts</p><p><strong>1. Trigger_Time<br>2. Trigger_Event<br>3. Table_name</strong></p><p><strong>1. Trigger_Time:</strong> Trigger time means when you want this trigger to run, for example, before or after an event.<br>In our below query, we used before why? Because we want our code to run before the code is inserted into our table.</p><p><strong>2. Trigger_Event:</strong> The trigger event is when we want to run this trigger, such as <strong>INSERT</strong>, <strong>UPDATE</strong>, and <strong>DELETE</strong></p><p>In the above example, we use INSERT because we want to run our trigger when the INSERT event is performed.</p><p><strong>3. Table_name:</strong> table name is the name of our table</p><p><strong>So let&#39;s discuss the trigger syntax in detail with a proper practical explanation</strong></p><p>of the code between <strong>BEGIN </strong>and <strong>END </strong>is whenever we insert a value in the Voter table, the trigger checks the age, whether it is less than 18 or greater than 18. Nothing happens if it is greater than or equal to 18, but if it is less than 18, the trigger will show an error, and we set the message.</p><p>For example, see the above image, <strong>we set message_text = &#39; age must be &gt;=18&#39;,</strong> so whenever we try to <strong>insert the value less than 18, this error message shows</strong>. In the output section, when we try to insert Andrew, 17, the query shows an error, which contains our <strong>custom message</strong>. So that&#39;s what triggers in SQL and how to use them in your query.</p><p><strong>Check the below code for a more practical understanding</strong></p><pre>DELIMITER $$<br>/* creating a trigger whose name is age_checker */<br>  CREATE TRIGGER age_checker<br>     /* defining when our triggerunsun before inserting or after inserting<br>        in our case we choose before inserting that&#39;s why we use BEFORE */<br>      BEFORE INSERT ON Voter FOR EACH ROW<br>      BEGIN <br>     /* Now we are checking the inserted value in our age column if it is <br>        less then 18 then show our error message */ <br>        IF NEW.age &lt; 18<br>        THEN <br>           SIGNAL SQLSTATE &#39;45000&#39;<br>              /* setting our error message in the MESSAGE_TEXT */<br>              SET MESSAGE_TEXT = &#39;AGE MUST BE &gt;= 18&#39;;<br>        END IF;<br>     END;<br>DELIMETER;</pre><h3><strong>2. Partition by in SQL</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBVqjH0II7gX_vJQEVNemw.png" /><figcaption>PARTITION BY in SQL | Source: Image by author</figcaption></figure><p>This post will discuss <strong>partition </strong>and how to use it in SQL.</p><p>So the first question is, what is a <strong>partition in SQL</strong>?</p><p><strong>The work of a partition is to group the rows with similar values but without limiting the rows.<br></strong>Let&#39;s take an example for more clarity.</p><p><strong>Please see the second image above.<br></strong>There are five rows in the table in which there is a column named gender with three male candidates and two female candidates, so what if we want a new column that shows the number of males and females?</p><p>The partition syntax group the rows according to a similar value, which means that in our query, we use partition by gender. It means that we want to group our rows according to gender, so there are only two unique values in the gender column first is M and the second is F, so it divides the rows into two groups.<br>1 The rows which contain M in the gender column<br>2 The rows have F in the gender column</p><p>, so that&#39;s the work of partition in SQL <br>, and we use the count function to count several rows in the group.</p><p>In the output, you can see that the new column is built whose name is no_of_male_female, and this column contains the number of rows in the group. For example, there are two rows in the F group, so it shows 2, and there are three rows in the M group, so it shows 3.</p><p><strong>Some might wonder <br></strong>what the difference is between group by and partition by in SQL because both works are similar. So the answer is that if you use a group, your five rows convert only into two rows. Why?</p><p>Because the group by shows the number of groups, in our above query, our table is divided into two groups, M and F, so the group by only shows the first row of every group, which means that if the group contains ten rows but it shows only 1 row<strong> </strong>in the output because it shows 1 row of every group.</p><p>But if you use partition by then, your number of rows remains unchanged as you see the number of rows in the output and the number of rows in the table remains the same.<br><strong>Partition in SQL shows all rows.<br></strong>Both have advantages and disadvantages you can use them according to your requirements.</p><p><strong>Check the below code if you need it</strong></p><pre>/* count function used to count number of gender after partition and then <br>   show output in no_of_male_female column */<br><br>SELECT * , COUNT(gender) OVER (PARTITION BY gender) <br>AS no_of_male_female FROM EMPLOYEE;</pre><h3><strong>3. Limit query</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*HvO_v8bARd1WirCoZCSqNg.jpeg" /><figcaption>LIMIT in SQL | Source: Image by author</figcaption></figure><p><strong>LIMIT in SQL and How it works, although LIMIT is not supported in some SQL databases, such as SQL servers and MS access.</strong></p><p>LIMIT clause is widely used in SQL databases and primarily to limit the row.<br>For example: If we want to find the top 10 or worst ten albums from the database, then the limit is beneficial. We use LIMIT 10 in the last of the query, and our work is done.</p><p>But here is a question how does LIMIT work, and how can we use it effectively?</p><p><strong>We can use LIMIT in two types</strong></p><p><strong>1. LIMIT ( any constant value ) <br></strong>For example, the below code selects the first eight rows from the table<br><strong>SELECT * FROM table_name LIMIT 8;</strong></p><p><strong>2. LIMIT(x, y) <br></strong>It&#39;s a more precise way to limit our tables.<br>The x argument is used to eliminate several rows from the top.<br>The y argument shows the number of rows you want after elimination.<br>For example: <br><strong>Select * FROM table_name LIMIT 3,2;<br></strong>this query eliminates three rows from the top and then shows the two rows after eliminating the three rows.</p><p><strong>Check the below code.</strong></p><pre>/* This command is used to select first two rows */<br><br>SELECT * FROM EMPLOYEE LIMIT 2;<br><br><br>/* This command is used to select 3 rows after eliminating first two rows */<br><br>SELECT * FROM EMPLOYEE LIMIT 2,3;<br></pre><h3><strong>4. COALESCE function</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjSrUtwfylmY8JUmRzwk5A.png" /><figcaption>COALESCE function in SQL | Source: Image by author</figcaption></figure><p>Do you know that there are some great functions in SQL which save you time?<br>Here I am talking about the <strong>COALESCE function,</strong> and this function amazes you, so please read the full post.</p><p><strong>The COALESCE function takes n number of values.</strong></p><pre>COALESCE(value_1,value_2,......, value_n)</pre><p>So let&#39;s understand this; please see the above 4th image. You see that there is an EMPLOYEE table that contains a column whose name is located, and in that column, there are 3 NULL values. So what if we want to replace that NULL value with a meaningful word? So as in the above image, we want to replace all the NULL values with the word Missing_value.</p><p>We can do that with COALESCE function simply by seeing the code in the above image. The COALESCE function replaces all the NULL values with the word Missing_value.</p><p>Let&#39;s understand COALESCE function step by step.<br><strong>Step 1: </strong>The first argument we pass in the COALESCE function is the column name in which we want to find NULL values. That&#39;s why we use location.</p><p><strong>Step 2</strong>: If it found some values, then nothing happens; as you will see in the output of the code in the image, the value remains the same, but if it found NULL values, then what it does that it simply replaces that NULL values with the word we give as the second argument in COALESCE function and we gave Missing_value as a second argument, and that&#39;s why it replaces all NULL value present in the location column with Missing_value.</p><p>So that&#39;s how to COALESCE function work in SQL. We were given the example of using a single column. We also do the same thing if we want to replace NULL values in multiple columns; we can also do that by following the above syntax.</p><p><strong>Check the below code.</strong></p><pre>/* So we are targeting the location column from our EMPLOYEE table and <br>   then replacing the NULL values with Missing_value text */<br>SELECT COALESCE(location,&quot;Missing_value&quot;) as Location<br>FROM EMPLOYEE;</pre><p>I hope this post will briefly explain how you use these essential queries in SQL and what are the benefits of using it. If you have any questions, feel free to ask in the comment section.</p><p>Subscribe my newsletter</p><p>Connect with me on <a href="https://www.linkedin.com/in/ashbabkhan">Linkedin</a></p><p><a href="https://medium.com/@ashbabkhan12">Ashbab khan - Medium</a></p><p>Till then, Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=408c724b67d0" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/useful-intermediate-sql-queries-for-data-science-408c724b67d0">4 Amazing SQL Queries for Data Science</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Different Ways To Find Outliers in the Data and How To Remove Them Using Interquartile Statistics.]]></title>
            <link>https://pub.towardsai.net/how-to-find-outliers-in-the-data-using-interquartile-range-statistics-in-python-266704600964?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/266704600964</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[ml-so-good]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Tue, 18 Oct 2022 15:53:02 GMT</pubDate>
            <atom:updated>2022-12-02T16:33:46.474Z</atom:updated>
            <content:encoded><![CDATA[<h3>Different Ways To Find Outliers in the Data and How To Remove Them Using Interquartile Statistics</h3><p>Outliers are the data points or observations far from other data points or very different from other data points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YmewvVPtNXvgDox1sfZBRQ.png" /><figcaption>Photo by <a href="https://unsplash.com/@sortino?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Joshua Sortino</a> on <a href="https://unsplash.com/s/photos/data-science?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>Why remove outliers from the data</h3><p>Outliers cause so much miscalculation when we use statistics on the data; let&#39;s say we have data with many outliers, and we are taking the Mean of the data, and some data points are much larger than the remaining data points then our mean value is going to be very different from actual mean for example the mean value without outlier is 5.6. due to outliers, it becomes 6.1, but this is one example. Imagine getting miscalculated values when using different statistics, so it is essential to check for outliers and try removing them.</p><h3>Spotting outliers in data using boxplot</h3><p>Boxplot is a great way to see much statistical information in our data, such as 0,25th,50th,75th, and 100 percentile values, also known as five summary statistics;</p><p>Five summary statistics are also known as quantiles which give a summary of the datasets such as variance in datasets, minimum values, maximum values, and Median, and also help us find outliers in the data.</p><p>We use the Mean value a lot to find the center of the data, but sometimes our datasets contain so many values which are so much different from the remaining values these values are also known as an outlier.</p><p>Let’s say we have data 2,3,4,6. If we find the mean value, it will give us a weight of 3.75, so this is an excellent value representing all the datasets. Still, what if the data is 2,3,4,6,38? Then, in this case, the mean value is near 10.6. This is not a good measure of representing the data, so in this type of data mean value doesn’t work. We need to use the Median. So let’s see what the median is and how the median helps us calculate another quartile. So quartile is just a single value such as 0.25 or 0.75 etc.</p><p>Let’s see what these five statistics are</p><p>These five statistics are</p><ol><li>0 (Minimum value)</li><li>0.25 (Median of the first half of the data)</li><li>0.50 (Median of the total data)</li><li>0.75 (Median of the second half of the data)</li><li>1 (Maximum value)</li></ol><p>The three essential quartiles are 0.25, 0.50, and 0.75, so let’s discuss these quartiles and how it helps us in calculating variance in our data. So some might you think, why not calculate variance using standard deviation? We can figure it out using std, but this gives us variance in the data. We don’t want that. We want the variance only between our 25th percentile data and 75th percentile data because we don’t want to include outliers in our data.</p><p>If you are unfamiliar with variance, then the variance tells us the values in the datasets are closely packed or very far away from each other, let’s say 1, 2, 3, 4. The variance in this is low, but in 1, 3, 6, and 9 then, the variance in this data is high compared to the previous one.</p><p>So how to calculate 0.25 or 25th percentile? So let’s say we have our previous data 2, 3, 4, 6, 38. The center value, which is 4, is the Median. Then divide the data into two parts 2, 3, 4 and 4, 6, 38. Take the Median of the first part of the data. This gives us 3, so 3 is the 25th percentile value, and taking the Median of the second part of the data shows us 6. This value is the 75th percentile value.</p><p>The median value represents the center of the total data; the 25th percentile shows the center of the first half of the data, and the 75th percentile indicates the center of the second half of the data.</p><p>We also calculate the interquartile range using these two statistics by simply subtracting the 25th percentile from the 75th. This gives us a value of IQR. If IQR is a significant value, we will say that variance is directly proportional to IQR. If the IQR value increases, the variance also increases, so below is a boxplot image showing our summary statistics using a diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YLzYYeNySm-jSBkzyg-vVQ.png" /><figcaption>Boxplot | Source: Image by author</figcaption></figure><p>So that&#39;s how the boxplot looks. We can easily spot the outliers in the data and quartile values, the yellow horizontal line denoting the Median, and other quartile values such as 0.25,0.75,1, etc.</p><h3>So let&#39;s remove these outliers from the data using interquartile statistics.</h3><p>The interquartile statistic is a way to find outliers in the data using the 25th and 75th percentile values, which we already discussed. So, how do we find the rows which contain outliers?</p><p>So to extract outliers, we need two values <br>1. 25th percentile value<br>2. 75th percentile value</p><p>And why we need these two values because the Interquartile range is the distance between the 25th percentile and the 75the percentile value, so let&#39;s find out these two values first; we need to import the Numpy library, which is used for doing numerical works in python.</p><pre># importing numpy libraries as np<br>import NumPy as np</pre><p>We talked about the 25th and 75th quartile in detail theoretically; let&#39;s see how to find these values practically using NumPy libraries, so below are two codes. There is a method in NumPy, which is called quantile(). This method is used to find the value of the quartiles, such as, in our case, we want the value of the 25th and 75th percentile of the Height column.</p><pre># Finding values of 25th percentile value<br>Q1 = np.quantile(data[&#39;Height&#39;],0.25)<br># Finding the value of the 75th percentile value<br>Q3 = np.quantile(data[&#39;Height&#39;],0.75)</pre><p>What the above syntax does is that it simply sorts the Height column and stores the 25th percentile value in Q1 and the 75th percentile value in Q3 to find the Interquartile statistic (IQR) value; we need to find the difference between Q3 and Q1.</p><pre># Finding the difference between Q3 and Q1<br>IQR = Q3 - Q1</pre><p>Now we calculated the (IQR) the next step is to calculate the two threshold values, thresh1, and thresh2, using IQR these threshold values are used to find outliers; any value which is less than thresh1 or greater than thresh2 is considered an outlier.</p><pre># Calculating thresh1 value<br>thresh1 = Q1 - 1.5*IQR<br># Calculating thresh2 value<br>thresh2 = Q3 + 1.5*IQR</pre><p>Now we get the value of the thresh1 and thresh2. The next step is to subset the rows in which the Height Column is smaller than thresh1 or greater than thresh2, and that&#39;s it</p><pre># Extracting the outlier from our data <br>[( data[&#39;Height&#39;] &lt; thresh1 ) | ( data[&#39;Height&#39;] &gt; thresh2)]</pre><p>now we successfully extracted the outliers from the data. Thank you for reading this article. You can also connect with me on <a href="https://www.linkedin.com/in/ashbabkhan/">LinkedIn.</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=266704600964" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/how-to-find-outliers-in-the-data-using-interquartile-range-statistics-in-python-266704600964">Different Ways To Find Outliers in the Data and How To Remove Them Using Interquartile Statistics.</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Important String function in SQL and how to use it]]></title>
            <link>https://ashbabkhan12.medium.com/important-string-function-in-sql-and-how-to-use-it-47ccd9c6d3cc?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/47ccd9c6d3cc</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Sun, 04 Sep 2022 04:20:54 GMT</pubDate>
            <atom:updated>2022-09-04T04:20:54.973Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will discuss some of the important SQL string function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x3SZX2sRz5Kf6EUDpMpBIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qo0JzDTYykKjlEDUUldL2w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OAr078cdm6tu8U8BC_nkHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9lQoHi9nJu7Ni9Znn_PMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U02n14FuFs7DEb8Rj-1Htw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p28N53mRJhFlvK-13TExoA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cZwnsjm_lP3PB5XeFV8DEQ.png" /></figure><p>I hope you find this post useful please feel free to share your thoughts regarding this post.</p><p>You can also contribute to me or buy me a coffee by clicking the below button to give a tip.</p><p>This will help a lot in creating awesome content for you.</p><p>Thanks for reading and happy coding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47ccd9c6d3cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Logical operators in SQL]]></title>
            <link>https://ashbabkhan12.medium.com/logical-operators-in-sql-763084e3dc6a?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/763084e3dc6a</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Sat, 03 Sep 2022 05:40:39 GMT</pubDate>
            <atom:updated>2022-09-03T05:54:26.626Z</atom:updated>
            <content:encoded><![CDATA[<p>In this post, we will discuss the logical operator in SQL in detail</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-2IiiRHcyBdcHt57EeaWdA.png" /><figcaption>logical operators in sql</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YwgDGQq_e8N6q6lShoNHhw.png" /><figcaption>logical operators in SQL</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1bpjhmUJt6Pdx2sohqkxOw.png" /><figcaption>logical operators in SQL</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ZwOrY30F0XkZf19NfCxCA.png" /><figcaption>logical operators in SQL</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lckcrjpfirkc6tKVWCFRXA.png" /><figcaption>logical operators in SQL</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PoctFTjmqARvjcoCmWzcyA.png" /><figcaption>logical operators in SQL</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-stfWz0npKMGX91vmTGE3g.png" /><figcaption>logical operators in SQL</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UPJX37cS5uOAq1WaP2cxNQ.png" /><figcaption>logical operators in SQL</figcaption></figure><p>I hope you find this post helpful you can follow me for more content and never forget to subscribe to email so that whenever I post an article you get it right in the mail.</p><p>also, you can buy me a coffee this will help me a lot.</p><p>Thanks for your time and happy coding</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=763084e3dc6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What are subqueries in SQL and how to use them in our query?]]></title>
            <link>https://ashbabkhan12.medium.com/what-are-subqueries-in-sql-and-how-to-use-them-in-our-query-7cdb8945296e?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cdb8945296e</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Mon, 13 Jun 2022 13:05:44 GMT</pubDate>
            <atom:updated>2022-09-04T05:28:46.340Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*ijueXrn-ZgkSfFbkaZXMOA.jpeg" /><figcaption>what are subqueries in SQL and how to use them in our query?</figcaption></figure><p>What are subqueries in SQL and how to use it in our query?<br>In this post, we will discuss in detail</p><p>So what is a subquery?<br>A query inside another or nested query is known as a subquery.</p><p>see the image above the query marked in green is a subquery and the query marked in red is the main query.</p><p>How does subquery work?<br>See the image below the subquery always runs first which means that<br>whatever the query is written in the inner query it always runs first and after it is done then our main query runs.</p><p>Why use subquery?<br>a subquery is helpful in some cases for example in the below image our inner query runs first so it will give us the average marks of students which is 50.16 and after that our query becomes</p><p>SELECT * FROM class_10 WHERE marks&gt;50.16;</p><p>because the inner query work is done and it gives us 50.16.</p><p>If you want to run the same query without an inner query then you have to first find the average marks and then use that average marks in the next query.</p><p>but with an inner query, it can be done very easily.</p><p>so that’s how the inner query is helpful to us.</p><p>and in the output, it selects only those rows in which marks are greater than the average.</p><p>so that’s about the inner query all the content I post is created by me so feel free to share with your network or download it.</p><p>Also, feel free to share your thoughts on how much you like this content or if you have any questions till then happy coding</p><p>Want to receive more subscribe to my newsletter</p><p>You can also help me by contributing to me or buying me a coffee by clicking the below tip button.</p><p>Thank you for reading this post</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cdb8945296e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to download a Youtube video only writing 5 lines of python code]]></title>
            <link>https://ashbabkhan12.medium.com/how-to-download-a-youtube-video-only-writing-5-lines-of-python-code-aea54bae6718?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/aea54bae6718</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Mon, 16 May 2022 06:21:52 GMT</pubDate>
            <atom:updated>2022-05-16T06:21:52.366Z</atom:updated>
            <content:encoded><![CDATA[<p>How to download a Youtube video only writing 5 lines of python code</p><p>Downloading a youtube video is a most challenging task we use different software for downloading a youtube video.</p><p>So what if I say you can download youtube videos by writing 5 lines of code</p><p>Sounds interesting</p><p>Look at the above image for source code and keep two things in mind</p><ol><li>The filter function I use is completely optional I use it for downloading specific resolution videos just as I use in the above syntax to download 720p video</li><li>The second is the download function in that I use E:\\videos this is my path where I want to download but you use yours.</li></ol><figure><img alt="How to download a Youtube video only writing 5 lines of python code" src="https://cdn-images-1.medium.com/max/630/1*yTRZOMpaVKE_erB_kw_6GA.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aea54bae6718" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to extract audio from video using Python]]></title>
            <link>https://ashbabkhan12.medium.com/how-to-extract-audio-from-video-using-python-bf364043cd47?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf364043cd47</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python-web-developer]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Mon, 09 May 2022 05:29:57 GMT</pubDate>
            <atom:updated>2022-05-09T05:29:57.080Z</atom:updated>
            <content:encoded><![CDATA[<p>How to extract audio from video using python</p><p>Sometimes we need audio of a particular video and we start finding tools or software to extract audio from the video so in this article we discuss how to do that with 4 lines of code using python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9tUOgH7JR_Sy-jVLPie0Tg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3jE2OirO-5FCML--ZMs0yQ.png" /><figcaption>How to attract audio from video using python</figcaption></figure><p>Follow the above image</p><p>Step 1 — Install moviepy</p><p>Step 2 — import moviepy.editor as m</p><p>Step 3 — enter the path of your video in which you want to extract audio from that</p><p>Step 4 — then enter the path and name in which you want to extract audio in the above image we want to save our file in audio.mp3 <br>Step 5 — Enjoy your Audio</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf364043cd47" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use python for google search]]></title>
            <link>https://ashbabkhan12.medium.com/how-to-use-python-for-google-search-1fdab9858357?source=rss-4b5fa6a0933c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fdab9858357</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Ashbab khan]]></dc:creator>
            <pubDate>Thu, 05 May 2022 12:41:14 GMT</pubDate>
            <atom:updated>2022-05-05T12:41:14.802Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you tired or bored of using the same technique to search in your browser.</p><p>Let’s try some techniques for searching using python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S29owZ7r0ZD5AwyQ8Q2Fcw.png" /><figcaption>how to use python for google search</figcaption></figure><p>See the above image you will get the idea of the syntax but some arguments need to be understood.</p><p>query: the query is just a variable that stores your query whatever you want to search enter into this query.</p><p>tld: it means which domain we want to use com or co.in</p><p>num: this gives us the number of results we want for example in the above program we want 10 results so we use num= 10</p><p>stop: what is the last stop if you use none in this it means that you want your program to search without limit.</p><p>pause: this ensures the number of steps between the HTTP requests</p><p>lang: you can also use language for searching such as lang=’en’</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fdab9858357" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>