{"id":17002,"date":"2020-04-19T06:33:29","date_gmt":"2020-04-19T10:33:29","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/python-ecommerce-part-1-merge-multiple-supplier-data-files-into-one-file\/"},"modified":"2020-04-19T15:16:54","modified_gmt":"2020-04-19T19:16:54","slug":"python-ecommerce-part-1-merge-multiple-supplier-data-files-into-one-file","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=17002","title":{"rendered":"Python: Ecommerce: Part \u2014 1: Merge Multiple Supplier Data Files into One File"},"content":{"rendered":"<article class=\"meteredContent\">\n<div>\n<section class=\"fr fs ih ii ij\">\n<div class=\"n p\">\n<div class=\"z ab ac ae af ik ah ai\">\n<h1 id=\"d570\" class=\"lz lo ap by bx ey io ma iq mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Section: Merge multiple Supplier Data Files<\/h1>\n<p id=\"b954\" class=\"jy jz ap by ka b kb mo kd mp kf mq kh mr kj ms kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\">All code in one block<\/strong><\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"ac81\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">#!\/usr\/bin\/env python\n# coding: utf-8<\/span><span id=\"4367\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># # Section: Merge multiple Supplier Data Files\n#<\/span><span id=\"9b83\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[1]:<\/span><span id=\"7715\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># if there is a need to merge multiple files \u2014 use this block\nimport os;\nimport glob;\nimport pandas as pd;<\/span><span id=\"7f7f\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># supplier data files\/feeds are kept here\ndata_folder = \u2018data-supplier-2019\u201304\u201314\/supplier-raw-data\/\u2019;\nos.chdir(data_folder);<\/span><span id=\"e43e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[6]:<\/span><span id=\"0dc7\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># show all data feed file name\n# file extension for supplier data file\nextension = \u2018csv\u2019;\nall_filenames = [i for i in glob.glob(\u2018*.{}\u2019.format(extension))]\nall_filenames<\/span><span id=\"6877\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[7]:<\/span><span id=\"9dc5\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># total number of rows combined all data files\/feeds\nrow_total_count = 0\nfor f in all_filenames:\n df_s = pd.read_csv(f)\n print(df_s.shape, f)\n row_total_count += df_s.shape[0]\nrow_total_count # print(row_total_count)<\/span><span id=\"171c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[8]:<\/span><span id=\"080d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># combine all files in the list\ncombined_csv = pd.concat([pd.read_csv(f) for f in all_filenames]);\ncombined_csv.shape<\/span><span id=\"094f\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[10]:<\/span><span id=\"09af\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># export combined data to a csv file\ncombined_csv.to_csv( \u201c..\/all_supplier_products_2019_04_14.csv\u201d, index=False, encoding=\u2019utf-8-sig\u2019)<\/span><span id=\"1dc2\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[13]:<\/span><span id=\"7b84\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># read csv data file and show data on the screen\ndf = pd.read_csv(\u2018..\/all_supplier_products_2019_04_14.csv\u2019);\ndf.head()<\/span><\/pre>\n<p id=\"c350\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\">The following is from Jupyter Notebook: Cell By Cell Display. Output data are also shown<\/strong><\/p>\n<p id=\"5171\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [1]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"cda4\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># if there is a need to merge multiple files -- use this block<\/em><\/span><span id=\"6b8e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">import<\/strong> os;<\/span><span id=\"ad10\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">import<\/strong> glob;<\/span><span id=\"b5c2\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">import<\/strong> pandas <strong class=\"lp km\">as<\/strong> pd;<\/span><span id=\"8f66\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># supplier data files\/feeds are kept here<\/em><\/span><span id=\"ee78\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">data_folder <strong class=\"lp km\">=<\/strong> 'data-supplier-2019-04-14\/supplier-raw-data\/';<\/span><span id=\"c744\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">os.chdir(data_folder);<\/span><\/pre>\n<p id=\"5063\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [6]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"a128\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># show all data feed file name<\/em><\/span><span id=\"0e80\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># file extension for supplier data file<\/em><\/span><span id=\"b866\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">extension <strong class=\"lp km\">=<\/strong> 'csv';<\/span><span id=\"db3a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">all_filenames <strong class=\"lp km\">=<\/strong> [i <strong class=\"lp km\">for<\/strong> i <strong class=\"lp km\">in<\/strong> glob.glob('*.{}'.format(extension))]<\/span><span id=\"d3e6\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">all_filenames<\/span><\/pre>\n<p id=\"ea53\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[6]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"3e41\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">['data_feeds_5e95c25a1f7f6.csv',\n 'data_feeds_5e95c2962d471.csv',\n 'data_feeds_5e95c2d255409.csv',\n 'data_feeds_5e95c30e63423.csv',\n 'data_feeds_5e95c38646478.csv',\n 'data_feeds_5e95c5dd76370.csv']<\/span><\/pre>\n<p id=\"0f50\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [7]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"859a\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># total number of rows combined all data files\/feeds<\/em><\/span><span id=\"104d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">row_total_count <strong class=\"lp km\">=<\/strong> 0<\/span><span id=\"268f\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">for<\/strong> f <strong class=\"lp km\">in<\/strong> all_filenames:<\/span><span id=\"d697\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">df_s <strong class=\"lp km\">=<\/strong> pd.read_csv(f)<\/span><span id=\"46d5\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">print(df_s.shape, f)<\/span><span id=\"c1c5\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">row_total_count <strong class=\"lp km\">+=<\/strong> df_s.shape[0]<\/span><span id=\"de44\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">row_total_count <em class=\"lt\"># print(row_total_count)<\/em><\/span><span id=\"b0d0\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">(8058, 40) data_feeds_5e95c25a1f7f6.csv\n(7, 40) data_feeds_5e95c2962d471.csv\n(1, 40) data_feeds_5e95c2d255409.csv<\/span><span id=\"a738\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">... ....\n(1072, 40) data_feeds_5e95c565d6e30.csv\n(4833, 40) data_feeds_5e95c5dd76370.csv<\/span><\/pre>\n<p id=\"e0c5\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[7]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"8ae5\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">55690<\/span><\/pre>\n<p id=\"e918\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [8]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"af97\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># combine all files in the list<\/em><\/span><span id=\"4cf4\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">combined_csv <strong class=\"lp km\">=<\/strong> pd.concat([pd.read_csv(f) <strong class=\"lp km\">for<\/strong> f <strong class=\"lp km\">in<\/strong> all_filenames]);<\/span><span id=\"4a55\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">combined_csv.shape<\/span><\/pre>\n<p id=\"de72\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[8]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"ad15\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">(55690, 40)<\/span><\/pre>\n<p id=\"1cbf\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [10]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"e6d0\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># export combined data to a csv file<\/em><\/span><span id=\"b147\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">combined_csv.to_csv( \"..\/all_supplier_products_2019_04_14.csv\", index<strong class=\"lp km\">=False<\/strong>, encoding<strong class=\"lp km\">=<\/strong>'utf-8-sig')<\/span><\/pre>\n<p id=\"1665\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [13]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"620f\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">df <strong class=\"lp km\">=<\/strong> pd.read_csv('..\/all_supplier_products_2019_04_14.csv');<\/span><span id=\"287b\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">df.head()<\/span><\/pre>\n<p id=\"038d\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[13]:<\/p>\n<p id=\"ae66\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Product ID Model Code Full Product NameShort Product NameProduct URLCategory NameCategory URLSubcategory NameSubcategory URLDate Product Was Launched\u2026Related ProductsRelated AccessoriesWeight KgHeight mmWidth mmDepth mmVideo linkRetail PriceStock statusDate Back0107890POU_0850GV7YPull Rope Fitness Exercises Resistance Bands L\u2026Pull Rope Fitness<\/p>\n<p id=\"80f2\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">***. ***. ***<\/em><\/strong><\/p>\n<p id=\"b9ed\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">Note: Older short-notes from this site are posted on Medium:\u00a0<\/em><\/strong><a class=\"cu dw mk ml mm mn\" href=\"https:\/\/medium.com\/@SayedAhmedCanada\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/medium.com\/@SayedAhmedCanada<\/a><\/p>\n<p id=\"b4a6\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">*** . *** *** . *** . *** . ***<\/p>\n<p id=\"fc38\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">Sayed Ahmed<\/em><\/strong><\/p>\n<p id=\"2ac0\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">BSc. Eng. in Comp. Sc. &amp; Eng. (BUET)<\/em><\/strong><\/p>\n<p id=\"53cb\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">MSc. in Comp. Sc. (U of Manitoba, Canada)<\/em><\/strong><\/p>\n<p id=\"176f\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">MSc. in Data Science and Analytics (Ryerson University, Canada)<\/em><\/strong><\/p>\n<p id=\"cd2c\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">Linkedin<\/em><\/strong><em class=\"lt\">:\u00a0<\/em><a class=\"cu dw mk ml mm mn\" href=\"https:\/\/ca.linkedin.com\/in\/sayedjustetc\" target=\"_blank\" rel=\"noopener nofollow noreferrer\"><em class=\"lt\">https:\/\/ca.linkedin.com\/in\/sayedjustetc<\/em><\/a><\/p>\n<p id=\"6952\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">Blog<\/em><\/strong><em class=\"lt\">:\u00a0<\/em><a class=\"cu dw mk ml mm mn\" href=\"http:\/\/bangla.salearningschool.com\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\"><em class=\"lt\">http:\/\/Bangla.SaLearningSchool.com<\/em><\/a><em class=\"lt\">,\u00a0<\/em><a class=\"cu dw mk ml mm mn\" href=\"http:\/\/sitestree.com\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\"><em class=\"lt\">http:\/\/SitesTree.com<\/em><\/a><\/p>\n<p id=\"9116\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">Training Courses:\u00a0<\/em><\/strong><a class=\"cu dw mk ml mm mn\" href=\"http:\/\/training.sitestree.com\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\"><em class=\"lt\">http:\/\/Training.SitesTree.com<\/em><\/a><\/p>\n<p id=\"9a9f\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">8112223 Canada Inc\/Justetc<\/em><\/strong><em class=\"lt\">:\u00a0<\/em><a class=\"cu dw mk ml mm mn\" href=\"http:\/\/justetc.net\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\"><em class=\"lt\">http:\/\/JustEtc.net<\/em><\/a><\/p>\n<p id=\"3838\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><strong class=\"ka km\"><em class=\"lt\">Facebook Groups\/Forums to discuss (Q &amp; A):<\/em><\/strong><\/p>\n<p id=\"3a2f\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><a class=\"cu dw mk ml mm mn\" href=\"https:\/\/www.facebook.com\/banglasalearningschool\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/www.facebook.com\/banglasalearningschool<\/a><\/p>\n<p id=\"edf3\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><a class=\"cu dw mk ml mm mn\" href=\"https:\/\/www.facebook.com\/justetcsocial\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/www.facebook.com\/justetcsocial<\/a><\/p>\n<p id=\"e9f3\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><em class=\"lt\">Get access to courses on Big Data, Data Science, AI, Cloud, Linux, System Admin, Web Development and Misc. related. Also, create your own course to sell to others.\u00a0<\/em><a class=\"cu dw mk ml mm mn\" href=\"http:\/\/sitestree.com\/training\/\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">http:\/\/sitestree.com\/training\/<\/a><\/p>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n<\/article>\n<div class=\"cq ig mt gl ai na my nb\" data-test-id=\"post-sidebar\">\n<div class=\"n p\">\n<div class=\"z ab ac ae af ag ah ai\">\n<div class=\"nc n hu\">\n<div class=\"ig\">\n<div class=\"nd fg r\">\n<h2 class=\"bx ey fz bz ap\">Build Ecommerce Software and Systems<\/h2>\n<div class=\"eu ne r\">\n<h4 class=\"bx fp cp bz av nf cj as ng au cc\">Build Ecommerce Software and Systems<\/h4>\n<\/div>\n<div class=\"cl\" aria-hidden=\"true\"><button class=\"dg ni nj nk nl nm nn bn do no np nq ds bx b by bz ca cb dt du dv cl dw bq\">Following<\/button><\/div>\n<\/div>\n<div class=\"nr ns nt n\">\n<div class=\"n o\">\n<div class=\"nu r cr\">\n<div class=\"\">\n<div>\n<div class=\"cl\" role=\"tooltip\" aria-hidden=\"true\" aria-describedby=\"1403\" aria-labelledby=\"1403\">\n<div class=\"bl nv nw nx ny nz oa ob jw oc od oe\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"ns r\"><\/div>\n<div>\n<div class=\"jw\">\n<div>\n<div class=\"cl\" role=\"tooltip\" aria-hidden=\"true\" aria-describedby=\"1404\" aria-labelledby=\"1404\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"cq ig mt gl mu mv mw mx my mz\"><\/div>\n<div>\n<div class=\"of og n hu p\">\n<div class=\"n p\">\n<div class=\"z ab ac ae af ik ah ai\">\n<div class=\"n ew\"><\/div>\n<div class=\"n o ew\"><\/div>\n<div class=\"oh r\">\n<ul class=\"bl bm\">\n<li class=\"cl fh fc ia\"><a class=\"oi oj dw cc r lm ok a b ib\" href=\"https:\/\/medium.com\/tag\/magento\">Magento<\/a><\/li>\n<li class=\"cl fh fc ia\"><a class=\"oi oj dw cc r lm ok a b ib\" href=\"https:\/\/medium.com\/tag\/ecommerce\">Ecommerce<\/a><\/li>\n<li class=\"cl fh fc ia\"><a class=\"oi oj dw cc r lm ok a b ib\" href=\"https:\/\/medium.com\/tag\/python\">Python<\/a><\/li>\n<li class=\"cl fh fc ia\"><a class=\"oi oj dw cc r lm ok a b ib\" href=\"https:\/\/medium.com\/tag\/php\">PHP<\/a><\/li>\n<li class=\"cl fh fc ia\"><a class=\"oi oj dw cc r lm ok a b ib\" href=\"https:\/\/medium.com\/tag\/data-processing\">Data Processing<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"ol n ev y\">\n<div class=\"n o\">\n<div class=\"nu r cr\">\n<div class=\"\">\n<div>\n<div class=\"cl\" role=\"tooltip\" aria-hidden=\"true\" aria-describedby=\"1405\" aria-labelledby=\"1405\">\n<div class=\"bl nv nw nx ny nz oa ob jw oc od oe\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"n o\">\n<div class=\"jv r bw\"><\/div>\n<div class=\"jv r bw\"><\/div>\n<div class=\"jv r bw\"><\/div>\n<div class=\"om r bw\">\n<div>\n<div class=\"jw\">\n<div>\n<div class=\"cl\" role=\"tooltip\" aria-hidden=\"true\" aria-describedby=\"1406\" aria-labelledby=\"1406\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"cl\" aria-hidden=\"true\">\n<div class=\"cl\" aria-hidden=\"true\">\n<div class=\"cl\" aria-hidden=\"true\">\n<div class=\"r bw\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"on he oo oh r y\">\n<div class=\"op oq r cr\">\n<div class=\"r s os ot\"><a href=\"https:\/\/medium.com\/@SayedAhmedCanada?source=follow_footer--------------------------follow_footer-\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"r dz hn ou\" src=\"https:\/\/miro.medium.com\/fit\/c\/80\/80\/0*P_esmjKoJnHlNjFX\" alt=\"8112223 Canada Inc. (Justetc)\" width=\"80\" height=\"80\" \/><\/a><\/div>\n<div class=\"ov r ow\">\n<p class=\"bx fp ib bz cc ox oy\">WRITTEN BY<\/p>\n<\/div>\n<div class=\"ov oz n ow\">\n<div class=\"ai n o ev\">\n<h2 class=\"bx ey gw gx ap\"><a class=\"cu cv bg bh bi bj bk bl bm bn cw cx bq br cy cz\" href=\"https:\/\/medium.com\/@SayedAhmedCanada?source=follow_footer--------------------------follow_footer-\" rel=\"noopener\">8112223 Canada Inc. (Justetc)<\/a><\/h2>\n<div class=\"r g\"><\/div>\n<\/div>\n<\/div>\n<div class=\"ov pa r ow bb\">\n<div class=\"pb r\">\n<h4 class=\"bx fp fz ga cc\">Software Engineer, Data Scientist, Machine Learning Engineer.<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"on r\"><\/div>\n<div class=\"op oq r cr\">\n<div class=\"r s os ot\"><a href=\"https:\/\/medium.com\/build-ecommerce-software-and-systems?source=follow_footer--------------------------follow_footer-\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"ds ou hn\" src=\"https:\/\/i0.wp.com\/miro.medium.com\/fit\/c\/80\/80\/1%2A2Kzjk3cDjNvBHhFyF2rtyA.jpeg?resize=80%2C80&#038;ssl=1\" alt=\"Build Ecommerce Software and Systems\" width=\"80\" height=\"80\" \/><\/a><\/div>\n<div class=\"ov oz n ow\">\n<div class=\"ai n o ev\">\n<h2 class=\"bx ey gw gx ap\"><a class=\"cu cv bg bh bi bj bk bl bm bn cw cx bq br cy cz\" href=\"https:\/\/medium.com\/build-ecommerce-software-and-systems?source=follow_footer--------------------------follow_footer-\" rel=\"noopener\">Build Ecommerce Software and Systems<\/a><\/h2>\n<div class=\"r g\">\n<div class=\"cl\" aria-hidden=\"true\"><button class=\"dg ni nj nk nl nm nn bn do no np nq ds bx b by bz ca cb dt du dv cl dw bq\">Following<\/button><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"ov pd r ow bb\">\n<div class=\"pb r\">\n<h4 class=\"bx fp fz ga cc\">Build Ecommerce Software and Systems<\/h4>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Section: Merge multiple Supplier Data Files All code in one block #!\/usr\/bin\/env python # coding: utf-8# # Section: Merge multiple Supplier Data Files ## In[1]:# if there is a need to merge multiple files \u2014 use this block import os; import glob; import pandas as pd;# supplier data files\/feeds are kept here data_folder = \u2018data-supplier-2019\u201304\u201314\/supplier-raw-data\/\u2019; &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=17002\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1912,182],"tags":[],"class_list":["post-17002","post","type-post","status-publish","format-standard","hentry","category-build-ecommerce-software","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":17001,"url":"http:\/\/bangla.sitestree.com\/?p=17001","url_meta":{"origin":17002,"position":0},"title":"Python: Ecommerce: Part\u200a\u2014\u200a1: Merge Multiple Supplier Data Files into One File","author":"Sayed","date":"April 18, 2020","format":false,"excerpt":"Python: Ecommerce: Part\u200a\u2014\u200a1: Merge Multiple Supplier Data Files into One File Section: Merge multiple Supplier Data Files All code in one block #!\/usr\/bin\/env python # coding: utf-8 # # Section: Merge multiple Supplier Data Files # # In[1]: # if there is a need to merge multiple files \u2014 use\u2026","rel":"","context":"In &quot;Build Ecommerce Software&quot;","block_context":{"text":"Build Ecommerce Software","link":"http:\/\/bangla.sitestree.com\/?cat=1912"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16964,"url":"http:\/\/bangla.sitestree.com\/?p=16964","url_meta":{"origin":17002,"position":1},"title":"Python: Merge Multiple csv files into one to facilitate reporting on transaction data over time","author":"Sayed","date":"March 21, 2020","format":false,"excerpt":"Python: Merge Multiple csv files into one to facilitate reporting on transaction data over time By Sayed Ahmed Merge multiple transaction files into one. This is an extension to the article: Python: Read RBC Canada: Mastercard PDF Statement Transaction Data into CSV file By Sayed Ahmedmedium.com The Code for Merging\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17008,"url":"http:\/\/bangla.sitestree.com\/?p=17008","url_meta":{"origin":17002,"position":2},"title":"Python: Ecommerce: Part \u2014 7: Partition a Data File (with product information) into Multiple Files.","author":"Sayed","date":"April 19, 2020","format":false,"excerpt":"In previous steps, we created a product data file to be uploaded to Magento 2 (from supplier data). However, there is a limit, how big a file can be uploaded to Magento 2 for product data import. Hence, this code will divide the data file into multiple files. This data\u2026","rel":"","context":"In &quot;Build Ecommerce Software&quot;","block_context":{"text":"Build Ecommerce Software","link":"http:\/\/bangla.sitestree.com\/?cat=1912"},"img":{"alt_text":"8112223 Canada Inc. (Justetc)","src":"https:\/\/miro.medium.com\/fit\/c\/80\/80\/0*P_esmjKoJnHlNjFX","width":350,"height":200},"classes":[]},{"id":16965,"url":"http:\/\/bangla.sitestree.com\/?p=16965","url_meta":{"origin":17002,"position":3},"title":"Python: Merge Multiple csv files into one to facilitate reporting on transaction data over time","author":"Sayed","date":"March 21, 2020","format":false,"excerpt":"Python: Merge Multiple csv files into one to facilitate reporting on transaction data over time","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16968,"url":"http:\/\/bangla.sitestree.com\/?p=16968","url_meta":{"origin":17002,"position":4},"title":"Python: Read Amex (American Express) Canada: Mastercard PDF Statement Transaction Data into CSV file","author":"Sayed","date":"March 26, 2020","format":false,"excerpt":"Python: Read Amex (American Express) Canada: PDF Statement Transaction Data into CSV file By Sayed Ahmed In general, you will get CSV files from your Amex card; However, sometimes you need to download in every 3 or 6 months. Otherwise, you might only get\/request pdf files for transactions (depends on\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17003,"url":"http:\/\/bangla.sitestree.com\/?p=17003","url_meta":{"origin":17002,"position":5},"title":"Python: Ecommerce: Part \u2014 2: Drop Duplicates, Sort, and Take Only Unique Products After Merging All Supplier D ata Files into One File","author":"Sayed","date":"April 19, 2020","format":false,"excerpt":"All code in One Block # # Section: Verify, and Process Supplier Data Before Sending products to # # your retail (Magento 2) or marketplace (Amazon, Walmart)# In[7]:# combined_csv.sort_values(\u201cModel Code\u201d, inplace = True) # dropping ALL duplicte values based on Product SKU = Model Codeno_duplicates_combined_csv = combined_csv.drop_duplicates(subset = \u201cModel Code\u201d,\u2026","rel":"","context":"In &quot;Build Ecommerce Software&quot;","block_context":{"text":"Build Ecommerce Software","link":"http:\/\/bangla.sitestree.com\/?cat=1912"},"img":{"alt_text":"8112223 Canada Inc. (Justetc)","src":"https:\/\/miro.medium.com\/fit\/c\/80\/80\/0*P_esmjKoJnHlNjFX","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/17002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17002"}],"version-history":[{"count":2,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/17002\/revisions"}],"predecessor-version":[{"id":17031,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/17002\/revisions\/17031"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17002"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}