{"id":702,"date":"2024-04-09T22:13:33","date_gmt":"2024-04-10T02:13:33","guid":{"rendered":"https:\/\/learnwithneha.site\/?p=702"},"modified":"2024-04-10T10:24:21","modified_gmt":"2024-04-10T14:24:21","slug":"elementor-702","status":"publish","type":"post","link":"https:\/\/learnwithneha.site\/?p=702","title":{"rendered":"Data Cleaning Project"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"702\" class=\"elementor elementor-702\">\n\t\t\t\t<div class=\"elementor-element elementor-element-453120d e-flex e-con-boxed e-con e-parent\" data-id=\"453120d\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1e9ca1e elementor-widget elementor-widget-text-editor\" data-id=\"1e9ca1e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><strong>Data Cleaning Using Panda<\/strong><\/p><p>Data cleaning is an essential step in the data analysis process, ensuring that your data is accurate, consistent, and reliable for analysis. Pandas, a popular Python library for data manipulation and analysis, provides powerful tools for data cleaning. Here&#8217;s an introduction to data cleaning in Pandas:<\/p><p><strong>Import Pandas<\/strong>: Before you start cleaning your data, you need to import the Pandas library. You can do this using the following import statement.<\/p><p>Pandas provides various functions to load data from different file formats such as CSV, Excel, SQL databases, etc.<\/p><p>For example:<\/p><p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-681 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/03\/data_cleaning_img-1.png\" alt=\"\" width=\"1352\" height=\"890\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data_cleaning_img-1.png 1352w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data_cleaning_img-1-300x197.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data_cleaning_img-1-1024x674.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data_cleaning_img-1-768x506.png 768w\" sizes=\"(max-width: 1352px) 100vw, 1352px\" \/><\/p><p><strong>Removing Duplicates<\/strong>: Duplicates in the dataset can skew analysis results. Pandas provides the <code>drop_duplicates()<\/code> method to remove duplicate rows. For example:<\/p><p><img decoding=\"async\" class=\"alignnone wp-image-682 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/03\/data-cleaning-img-2.png\" alt=\"\" width=\"1349\" height=\"892\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-2.png 1349w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-2-300x198.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-2-1024x677.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-2-768x508.png 768w\" sizes=\"(max-width: 1349px) 100vw, 1349px\" \/><\/p><p><strong>Removing unnecessary columns like &#8220;not useful&#8221;<\/strong><\/p><p><img decoding=\"async\" class=\"alignnone wp-image-683 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/03\/data-cleaning-img-3.png\" alt=\"\" width=\"1357\" height=\"898\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-3.png 1357w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-3-300x199.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-3-1024x678.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-3-768x508.png 768w\" sizes=\"(max-width: 1357px) 100vw, 1357px\" \/><\/p><p><strong>Cleaning up the &#8220;last name&#8221; column<\/strong>: removing forward slashes, dots etc.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-684 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/03\/data-cleaning-img-4.png\" alt=\"\" width=\"1349\" height=\"894\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-4.png 1349w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-4-300x199.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-4-1024x679.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/03\/data-cleaning-img-4-768x509.png 768w\" sizes=\"(max-width: 1349px) 100vw, 1349px\" \/><\/p><p><strong>Standardizing phone numbers<\/strong> by removing various formats and NaNs<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-693 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/04\/phone1.png\" alt=\"\" width=\"938\" height=\"726\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/phone1.png 938w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/phone1-300x232.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/phone1-768x594.png 768w\" sizes=\"(max-width: 938px) 100vw, 938px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-692 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/04\/phone2.png\" alt=\"\" width=\"915\" height=\"717\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/phone2.png 915w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/phone2-300x235.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/phone2-768x602.png 768w\" sizes=\"(max-width: 915px) 100vw, 915px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-691 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/04\/phone3.png\" alt=\"\" width=\"924\" height=\"716\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/phone3.png 924w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/phone3-300x232.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/phone3-768x595.png 768w\" sizes=\"(max-width: 924px) 100vw, 924px\" \/><\/p><p><strong>Handling Address<\/strong> data by splitting it into separate columns for better readability<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-690 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/04\/address.png\" alt=\"\" width=\"1218\" height=\"698\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/address.png 1218w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/address-300x172.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/address-1024x587.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/address-768x440.png 768w\" sizes=\"(max-width: 1218px) 100vw, 1218px\" \/><\/p><p>Standardizing values in the &#8220;paying customer&#8221; and &#8220;Do Not Contact &#8221; column to &#8220;Y&#8221; and &#8220;N&#8221;<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-689 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/04\/yes-no.png\" alt=\"\" width=\"1244\" height=\"767\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/yes-no.png 1244w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/yes-no-300x185.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/yes-no-1024x631.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/yes-no-768x474.png 768w\" sizes=\"(max-width: 1244px) 100vw, 1244px\" \/><\/p><p><strong>Remove All NAN<\/strong> and fill it with blank<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-728 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/04\/remove-na.png\" alt=\"\" width=\"1226\" height=\"765\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/remove-na.png 1226w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/remove-na-300x187.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/remove-na-1024x639.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/remove-na-768x479.png 768w\" sizes=\"(max-width: 1226px) 100vw, 1226px\" \/><br \/><br \/><strong>Remove rows<\/strong> who don&#8217;t want to be contacted.<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-688 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/04\/removewho-dont-want-.png\" alt=\"\" width=\"1163\" height=\"638\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/removewho-dont-want-.png 1163w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/removewho-dont-want--300x165.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/removewho-dont-want--1024x562.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/removewho-dont-want--768x421.png 768w\" sizes=\"(max-width: 1163px) 100vw, 1163px\" \/><\/p><p>Also Remove the Rows Where we <strong>don&#8217;t have any phone number<\/strong><\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-687 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/04\/removeblank-phone.png\" alt=\"\" width=\"1166\" height=\"465\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/removeblank-phone.png 1166w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/removeblank-phone-300x120.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/removeblank-phone-1024x408.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/removeblank-phone-768x306.png 768w\" sizes=\"(max-width: 1166px) 100vw, 1166px\" \/><\/p><p><strong>Reset Index<\/strong><\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-686 size-full\" src=\"https:\/\/nehaportfolio.tech\/wp-content\/uploads\/2024\/04\/reset_index.png\" alt=\"\" width=\"1187\" height=\"399\" srcset=\"https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/reset_index.png 1187w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/reset_index-300x101.png 300w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/reset_index-1024x344.png 1024w, https:\/\/learnwithneha.site\/wp-content\/uploads\/2024\/04\/reset_index-768x258.png 768w\" sizes=\"(max-width: 1187px) 100vw, 1187px\" \/><\/p><p><strong>Note<\/strong> :&#8211; &#8220;<strong>In the end, our data cleaning project has made a big difference. We turned messy data into clear, useful information. By paying attention to details and being careful, we&#8217;ve made sure our data is reliable. As we finish up, remember: keeping data clean isn&#8217;t just important\u2014it&#8217;s the key to understanding and making good decisions.<\/strong>&#8220;<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Data Cleaning Using Panda Data cleaning is an essential step in the data analysis process, ensuring that your data is accurate, consistent, and reliable for analysis. Pandas, a popular Python library for data manipulation and analysis, provides powerful tools for data cleaning. Here&#8217;s an introduction to data cleaning in Pandas: Import Pandas: Before you start [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":720,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,19],"tags":[],"class_list":["post-702","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-panda","category-python"],"_links":{"self":[{"href":"https:\/\/learnwithneha.site\/index.php?rest_route=\/wp\/v2\/posts\/702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learnwithneha.site\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learnwithneha.site\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learnwithneha.site\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learnwithneha.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=702"}],"version-history":[{"count":32,"href":"https:\/\/learnwithneha.site\/index.php?rest_route=\/wp\/v2\/posts\/702\/revisions"}],"predecessor-version":[{"id":741,"href":"https:\/\/learnwithneha.site\/index.php?rest_route=\/wp\/v2\/posts\/702\/revisions\/741"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learnwithneha.site\/index.php?rest_route=\/wp\/v2\/media\/720"}],"wp:attachment":[{"href":"https:\/\/learnwithneha.site\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learnwithneha.site\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learnwithneha.site\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}