{"id":17005,"date":"2020-04-19T06:39:03","date_gmt":"2020-04-19T10:39:03","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/python-ecommerce-part-4-calculate-your-sell-prices-for-your-retail-website-and-then-calculate-for-amazon-and-ebay\/"},"modified":"2021-04-06T18:28:39","modified_gmt":"2021-04-06T22:28:39","slug":"python-ecommerce-part-4-calculate-your-sell-prices-for-your-retail-website-and-then-calculate-for-amazon-and-ebay","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=17005","title":{"rendered":"Python: Ecommerce: Part \u2014 4: Calculate Your Sell Prices for your Retail Website, and then calculate for Amazon  and Ebay"},"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<p id=\"b071\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">The requirements for each of the sales channel can be different such as for Ebay you might want to calculate Paypal fees; for Amazon you have to check for Amazon fees. For your own retail site, shipping cost might need different calculation as well as based on your target audience tax\/hst will affect the price.<\/p>\n<p id=\"e784\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Use these code as a guidance and adjust as per your need.<\/p>\n<p id=\"fdfb\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Read the comments in the code. The comments explain what the code is doing. Check the previous articles in this series to make this article make more sense.<\/p>\n<p id=\"1f33\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">I will put the cell by cell code from Jupyter Notebook first; then will paste all the code in one block. If Medium does not maintain the indent, do it yourself when using the code.<\/p>\n<p id=\"8f60\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">This article will focus on Price calculation for Magento Based Retail Website. Calculation is not really platform dependent. At one point this data will be saved for Magento 2 platform to be uploaded.<\/p>\n<h1 id=\"5bdf\" class=\"lz lo ap by bx ey io ma iq mb mc md me mf mg mh mi\" data-selectable-paragraph=\"\">Section Data Upload for Magento 2.<\/h1>\n<p id=\"ad56\" class=\"jy jz ap by ka b kb mo kd mp kf mq kh mr kj ms kl fr\" data-selectable-paragraph=\"\">In [1]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"9bc9\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">import<\/strong> pandas <strong class=\"lp km\">as<\/strong> pd<\/span><\/pre>\n<p id=\"cd96\" 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\"># output file will be dated<\/em><\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"ae5e\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">from<\/strong> datetime <strong class=\"lp km\">import<\/strong> date;<\/span><span id=\"936e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">today <strong class=\"lp km\">=<\/strong> date.today()<\/span><span id=\"f71e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">today <strong class=\"lp km\">=<\/strong> today.strftime(\"%Y-%m-%d\")<\/span><span id=\"6ead\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">today<\/span><\/pre>\n<p id=\"0f94\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[2]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"aee6\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">'2020-04-17'<\/span><\/pre>\n<p id=\"36b7\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [3]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"5d07\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">data_folder <strong class=\"lp km\">=<\/strong> 'data-supplier-2020-04-14\/';<\/span><span id=\"0e3d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">template_folder <strong class=\"lp km\">=<\/strong> '.\/templates\/'<\/span><\/pre>\n<p id=\"276f\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [4]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"1f16\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">input_file_name <strong class=\"lp km\">=<\/strong> 'all_supplier_data_unique_sorted_and_filtered.csv';<\/span><span id=\"559d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">raw_file <strong class=\"lp km\">=<\/strong> data_folder <strong class=\"lp km\">+<\/strong> input_file_name;<\/span><span id=\"907e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">raw_file<\/span><\/pre>\n<p id=\"ca53\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[4]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"cb97\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">'data-supplier-2020-04-14\/all_supplier_data_unique_sorted_and_filtered.csv'<\/span><\/pre>\n<p id=\"a372\" 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<p id=\"5b70\" 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\"># read data from the combined sorted filtered file<\/em><\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"fa6d\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">raw_df <strong class=\"lp km\">=<\/strong> pd.read_csv(raw_file)<\/span><span id=\"edfa\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">raw_df.head(2)<\/span><\/pre>\n<p id=\"9fb3\" 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<p id=\"42f8\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Unnamed: 0Product IDModel CodeFull Product NameShort Product NameProduct URLCategory NameCategory URLSubcategory NameSubcategory URL\u2026Related ProductsRelated AccessoriesWeight KgHeight mmWidth mmDepth mmVideo linkRetail PriceStock statusDate Back0899230399A01AL3301111Black 3x3x3 MoYu AoLong V2 PuzzleBlack 3x3x3 MoYu AoLong V2 Puzzle<\/p>\n<p id=\"438a\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">2 rows \u00d7 41 columns<\/p>\n<p id=\"c3eb\" 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<p id=\"7552\" 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\"># check product price and columns<\/em><\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"a96b\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">raw_df[:1]['1pc Price'], raw_df.shape, raw_df.columns<\/span><\/pre>\n<p id=\"d43c\" 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=\"eccd\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">(0    12.9\n Name: 1pc Price, dtype: float64,\n (44911, 41),\n Index(['Unnamed: 0', 'Product ID', 'Model Code', 'Full Product Name',\n        'Short Product Name', 'Product URL', 'Category Name', 'Category URL',\n        'Subcategory Name', 'Subcategory URL', 'Date Product Was Launched',\n        'Main Product Picture', 'Currency', '1pc Price',\n        '1pc Cheapest Postal Shipping Price',\n        '1pc Cheapest Express Courier Shipping Price', 'EAN',\n        'Soon Discontinued', 'Full Product Description Part 1',\n        'Full Product Description Part 2', 'Short Description',\n        'Additional Product Picture 1', 'Additional Product Picture 2',\n        'Additional Product Picture 3', 'Additional Product Picture 4',\n        'Additional Product Picture 5', 'Additional Product Picture 6',\n        'Additional Product Picture 7', 'Additional Product Picture 8',\n        'Additional Product Picture 9', 'Additional Product Picture 10',\n        'Related Products', 'Related Accessories', 'Weight Kg', 'Height mm',\n        'Width mm', 'Depth mm', 'Video link', 'Retail Price', 'Stock status',\n        'Date Back'],\n       dtype='object'))<\/span><\/pre>\n<p id=\"2ea2\" 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<p id=\"714c\" 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\"># Now, sell prices and related will be calculated including sell prices for amazon and ebay<\/em><\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"aff5\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># The output column names are kept in a csv file.<\/em><\/span><span id=\"8293\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># Reading the column names from that template file<\/em><\/span><span id=\"1562\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_calculation_template_file <strong class=\"lp km\">=<\/strong> template_folder  <strong class=\"lp km\">+<\/strong> 'price_calculations_template.csv'<\/span><span id=\"00ad\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_calculation_template <strong class=\"lp km\">=<\/strong> pd.read_csv(price_calculation_template_file)<\/span><span id=\"6fe4\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_calculation_template.head(), price_calculation_template.columns<\/span><\/pre>\n<p id=\"e33f\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[10]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"2ab7\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">(Empty DataFrame\n Columns: [product_id, sku, Name, raw_price, dummy, cheapest_courier_shipping, product_ean, Ship Risk, Price Risk, Total, Risk Return , Total with ship, Referral Fee, Paypal Fees, Final Value Fee, Insertion Fee , HST, EU Vat, Currency Risk, shopforsoul_profit, ebay_profit, Income Tax, shopforsoul_cost, MLP, Special List Price, special_from_date, special_to_date, ebay_cost, ebay_list_price, Buyer pay from Mall, Ebay Buyers Pay, Ebay vs Mall, NA-1, Amazon Final Value Fee, amazon_profit, amazon_our_cost, amazon_list_price, amazon_special_price, Amazon Final Value Fee USD, amazon_profit_usd, amazon_our_cost_usd, amazon_list_price_usd, amazon_special_price_usd, amazon_list_price_gbp, amazon_special_price_gbp, amazon_list_price_eu, amazon_special_price_eu, amazon_list_price_mxn, amazon_special_price_mxn, ama_safe_refund_amount, Weight, Stock status, _category, _root_category, Visibility, Original Weight, Height mm, Width mm, Depth mm, status, Retail Price, original in stock, R+shipp, Shop vs retail, Soon Discontinued, weight right, Ship Right, Is Normal, amazon_ca_minimum_price, amazon_usd_minimum_price, amazon_gbp_minimum_price, amazon_eu_minimum_price, amazon_mxn_minimum, amazon_ca_abs_minimum, expedited_cost]\n Index: []\n \n [0 rows x 75 columns],\n Index(['product_id', 'sku', 'Name', 'raw_price', 'dummy',\n        'cheapest_courier_shipping', 'product_ean', 'Ship Risk', 'Price Risk',\n        'Total', 'Risk Return ', 'Total with ship', 'Referral Fee',\n        'Paypal Fees', 'Final Value Fee', 'Insertion Fee ', 'HST', 'EU Vat',\n        'Currency Risk', 'shopforsoul_profit', 'ebay_profit', 'Income Tax',\n        'shopforsoul_cost', 'MLP', 'Special List Price', 'special_from_date',\n        'special_to_date', 'ebay_cost', 'ebay_list_price',\n        'Buyer pay from Mall', 'Ebay Buyers Pay', 'Ebay vs Mall', 'NA-1',\n        'Amazon Final Value Fee', 'amazon_profit', 'amazon_our_cost',\n        'amazon_list_price', 'amazon_special_price',\n        'Amazon Final Value Fee USD', 'amazon_profit_usd',\n        'amazon_our_cost_usd', 'amazon_list_price_usd',\n        'amazon_special_price_usd', 'amazon_list_price_gbp',\n        'amazon_special_price_gbp', 'amazon_list_price_eu',\n        'amazon_special_price_eu', 'amazon_list_price_mxn',\n        'amazon_special_price_mxn', 'ama_safe_refund_amount', 'Weight',\n        'Stock status', '_category', '_root_category', 'Visibility',\n        'Original Weight', 'Height mm', 'Width mm', 'Depth mm', 'status',\n        'Retail Price', 'original in stock', 'R+shipp', 'Shop vs retail',\n        'Soon Discontinued', 'weight right', 'Ship Right', 'Is Normal',\n        'amazon_ca_minimum_price', 'amazon_usd_minimum_price',\n        'amazon_gbp_minimum_price', 'amazon_eu_minimum_price',\n        'amazon_mxn_minimum', 'amazon_ca_abs_minimum', 'expedited_cost'],\n       dtype='object'))<\/span><span id=\"2494\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#price_calculation_template.columns<\/em><\/span><span id=\"19e6\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#raw_df.columns, price_calculation_template.columns<\/em><\/span><\/pre>\n<p id=\"eff2\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [11]:<\/p>\n<p id=\"801e\" 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\"># create a dataframe to store the prices<\/em><\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"6bc8\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">price_calculation_df <strong class=\"lp km\">=<\/strong> pd.DataFrame()<\/span><\/pre>\n<p id=\"dbed\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [12]:<\/p>\n<p id=\"af44\" 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\"># take some column value as is : This block is not used any more<\/em><\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"2862\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">\"\"\"<\/span><span id=\"ce6c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_calculation_df[<\/span><span id=\"2b1f\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">[<\/span><span id=\"d292\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'product_id',<\/span><span id=\"ca8e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'sku',<\/span><span id=\"7422\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'Name',<\/span><span id=\"802d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'raw_price',<\/span><span id=\"9922\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'Postal Shipping Price',<\/span><span id=\"8353\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'cheapest_courier_shipping',<\/span><span id=\"e992\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'product_ean'<\/span><span id=\"e673\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">]<\/span><span id=\"7453\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">] = raw_df[<\/span><span id=\"e843\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">[<\/span><span id=\"0c58\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'Product ID',<\/span><span id=\"ceaa\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'Model Code',<\/span><span id=\"abe9\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'Full Product Name',<\/span><span id=\"a0b8\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'1pc Price',<\/span><span id=\"965c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'1pc Cheapest Postal Shipping Price',<\/span><span id=\"1357\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'1pc Cheapest Express Courier Shipping Price',<\/span><span id=\"1ca7\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">'EAN'<\/span><span id=\"5b42\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">]<\/span><span id=\"4177\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">]<\/span><span id=\"b394\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">\"\"\"<\/span><\/pre>\n<p id=\"e250\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[12]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"1a27\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">\"\\nprice_calculation_df[\\n        [\\n        'product_id', \\n        'sku', \\n        'Name',\\n        'raw_price', \\n        'Postal Shipping Price',\\n        'cheapest_courier_shipping', \\n        'product_ean'\\n        ]\\n    ] = raw_df[\\n            [\\n                'Product ID', \\n                'Model Code', \\n                'Full Product Name',                \\n                '1pc Price', \\n                '1pc Cheapest Postal Shipping Price',\\n                '1pc Cheapest Express Courier Shipping Price', \\n                'EAN'                \\n            ]\\n        ]\\n\\n\"<\/span><\/pre>\n<p id=\"29f1\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [ ]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"7923\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># take some columns from the raw input dataframe to the output price calculation data frame<\/em><\/span><span id=\"5ab4\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># The terms A2, B2, C2 were used for a reason. Previously the calulations were being done in Excel and later converted to<\/em><\/span><span id=\"248d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># Python code. To make the conversion easy, the cell names are kept intact. You can modify i.e. replace A2, B2, C2 with names you like,<\/em><\/span><span id=\"044e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># you can even remove them and adjust the code with dataframe columns<\/em><\/span><\/pre>\n<p id=\"d253\" 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=\"9a6f\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># keep product id as is<\/em><\/span><span id=\"3219\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">A2 <strong class=\"lp km\">=<\/strong> price_calculation_df['product_id'] <strong class=\"lp km\">=<\/strong> raw_df['Product ID']<\/span><span id=\"0dda\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># modify product sku<\/em><\/span><span id=\"e927\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">B2 <strong class=\"lp km\">=<\/strong> price_calculation_df['sku'] <strong class=\"lp km\">=<\/strong> 'shopforsoul-' <strong class=\"lp km\">+<\/strong> raw_df['Model Code']<\/span><span id=\"437b\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># create product name. added code to the name. this might for verification purpose such as to refer to the supplier<\/em><\/span><span id=\"6b33\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">C2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Name'] <strong class=\"lp km\">=<\/strong> raw_df['Full Product Name'] <strong class=\"lp km\">+<\/strong> '-' <strong class=\"lp km\">+<\/strong> raw_df['Model Code']<\/span><span id=\"dd42\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">D2 <strong class=\"lp km\">=<\/strong> price_calculation_df['raw_price'] <strong class=\"lp km\">=<\/strong> raw_df['1pc Price']<\/span><span id=\"0af3\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">E2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Postal Shipping Price'] <strong class=\"lp km\">=<\/strong> raw_df['1pc Cheapest Postal Shipping Price']<\/span><span id=\"3013\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">F2 <strong class=\"lp km\">=<\/strong> price_calculation_df['cheapest_courier_shipping'] <strong class=\"lp km\">=<\/strong> raw_df['1pc Cheapest Express Courier Shipping Price']<\/span><span id=\"23fc\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">G2 <strong class=\"lp km\">=<\/strong> price_calculation_df['product_ean'] <strong class=\"lp km\">=<\/strong> raw_df['EAN']<\/span><span id=\"eab3\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#price_calculation_df['product_ean'] [:-3]<\/em><\/span><\/pre>\n<p id=\"2c04\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [14]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"c1b4\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">list(price_calculation_df['Name'][:1])<\/span><\/pre>\n<p id=\"19fd\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[14]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"6069\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">['Black 3x3x3 MoYu AoLong V2 Puzzle-A01AL3301111']<\/span><\/pre>\n<p id=\"8c32\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [16]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"310e\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">raw_df['1pc Cheapest Postal Shipping Price'][:2]<\/span><\/pre>\n<p id=\"1afb\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[16]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"54ef\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">0    No Postal Shipping Available\n1    No Postal Shipping Available\nName: 1pc Cheapest Postal Shipping Price, dtype: object<\/span><\/pre>\n<p id=\"6a72\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [21]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"1de1\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># adjust cheapest_courier_shipping as supplied by supplier<\/em><\/span><\/pre>\n<p id=\"4ab2\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [22]:<\/p>\n<p id=\"7c75\" 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\"># bring all F2 processing : cheapest_courier_shipping : replace no with $500 i.e. dificult and do not want to sell<\/em><\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"dcbe\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">F2 <strong class=\"lp km\">=<\/strong> F2.replace('NaN','500')<\/span><span id=\"014a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">F2 <strong class=\"lp km\">=<\/strong> F2.replace('nan','500')<\/span><\/pre>\n<p id=\"eec8\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [23]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"618c\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#F2.unique()<\/em><\/span><span id=\"0304\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#No Courier Shipping Available, replace with 500<\/em><\/span><span id=\"c22b\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#F2 = price_calculation_df['cheapest_courier_shipping'] = F2.replace('No Courier Shipping Available','500')#.astype(float)<\/em><\/span><span id=\"b549\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">F2 <strong class=\"lp km\">=<\/strong> price_calculation_df['cheapest_courier_shipping'] <strong class=\"lp km\">=<\/strong> F2.replace('No Postal Shipping Available','500')<em class=\"lt\">#.astype(float)<\/em><\/span><span id=\"04fb\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">F2 <strong class=\"lp km\">=<\/strong> price_calculation_df['cheapest_courier_shipping'] <strong class=\"lp km\">=<\/strong> F2.astype(float)<\/span><span id=\"c959\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">F2 <strong class=\"lp km\">=<\/strong> price_calculation_df['cheapest_courier_shipping'] <strong class=\"lp km\">=<\/strong> price_calculation_df['cheapest_courier_shipping'].replace(',','')<\/span><\/pre>\n<p id=\"ef98\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [24]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"e1ab\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">price_calculation_df['cheapest_courier_shipping'][:5]<\/span><\/pre>\n<p id=\"27b0\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[24]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"75aa\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">0    500.0\n1    500.0\n2    500.0\n3    500.0\n4    500.0\nName: cheapest_courier_shipping, dtype: float64<\/span><\/pre>\n<p id=\"0069\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [25]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"ea5c\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># adjust cheapest_courier_shipping as provided by the supplier<\/em><\/span><\/pre>\n<p id=\"7745\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [26]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"1d6f\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">E2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Postal Shipping Price'] <strong class=\"lp km\">=<\/strong> E2.replace('No Postal Shipping Available','500')<\/span><span id=\"f557\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">E2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Postal Shipping Price'] <strong class=\"lp km\">=<\/strong> E2.astype(float)<\/span><span id=\"ca50\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">E2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Postal Shipping Price'] <strong class=\"lp km\">=<\/strong> price_calculation_df['Postal Shipping Price'].replace(',','')<\/span><\/pre>\n<p id=\"7d48\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [28]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"a394\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">sorted(F2, reverse<strong class=\"lp km\">=True<\/strong>)[:5]<\/span><\/pre>\n<p id=\"a084\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[28]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"d85f\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">[500.0, 500.0, 500.0, 500.0, 500.0]<\/span><\/pre>\n<p id=\"7dbc\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [30]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"d263\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># check the output file so far<\/em><\/span><span id=\"0653\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_calculation_df.head(2)<\/span><\/pre>\n<p id=\"d870\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[30]:<\/p>\n<p id=\"a968\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">product_idskuNameraw_pricePostal Shipping Pricecheapest_courier_shippingproduct_ean030399shopforsoul-A01AL3301111Black 3x3x3 MoYu AoLong V2 Puzzle-A01AL330111112.90500.0500.06.941378e+12138649shopforsoul-A01AL3303110Qiyun AoLong V2 3x3x3 Speed Cube Enhanced Edit\u202613.61500.0500.06.941378e+12<\/p>\n<p id=\"a4aa\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [31]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"fefe\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># adjust product EAN. Product EAN are matched with Amazon to find the Amazon Product ID : ASIN<\/em><\/span><span id=\"3f59\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">G2 <strong class=\"lp km\">=<\/strong> price_calculation_df['product_ean'] <strong class=\"lp km\">=<\/strong> price_calculation_df['product_ean'].astype(str)<\/span><span id=\"7e4e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_calculation_df['product_ean'][:4]<\/span><\/pre>\n<p id=\"38b4\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[31]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"2c67\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">0    6941377886603.0\n1    6941377965988.0\n2    6941377972443.0\n3    6941377953466.0\nName: product_ean, dtype: object<\/span><\/pre>\n<p id=\"0d10\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [32]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"bfea\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">type(F2)<\/span><\/pre>\n<p id=\"c809\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[32]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"fb99\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">pandas.core.series.Series<\/span><\/pre>\n<p id=\"5ae5\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [33]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"ebdf\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># define some constants to calculate your target price such as currency rates, shipping risk, hst, your tax burden. Some below are in percentages<\/em><\/span><\/pre>\n<p id=\"ffcb\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [34]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"f5ec\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">ship_risk_percent <strong class=\"lp km\">=<\/strong> 0.03<\/span><span id=\"766a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_risk_percent <strong class=\"lp km\">=<\/strong> 0.03<\/span><span id=\"0d54\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">return_risk_percent <strong class=\"lp km\">=<\/strong> 0.05 <em class=\"lt\">#or max $XX<\/em><\/span><span id=\"cd82\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">max_return_amount <strong class=\"lp km\">=<\/strong> 5<\/span><span id=\"7087\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">referral_rate <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"55fe\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">paypal_fee_rate <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"07de\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">final_value_fee_rate <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"b808\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">insertion_fee_rate <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"345e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">hst_rate <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"c4a3\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">eu_vat_rate <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"e7c4\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">currency_risk <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"b742\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">sfs_profit <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"8a4f\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">ebay_profit <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"0011\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">income_tax <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"409a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">sfs_special_profit <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"d27c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">special_from_date <strong class=\"lp km\">=<\/strong> '2020-04-03'<\/span><span id=\"26ff\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">special_to_date <strong class=\"lp km\">=<\/strong> '2020-06-30'<\/span><span id=\"69c8\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">amazon_final_fee_rate <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"7647\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">amazon_profit <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"bb65\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">amazon_special_profit <strong class=\"lp km\">=<\/strong> 0.001<\/span><span id=\"2477\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">cad_to_usd <strong class=\"lp km\">=<\/strong> 0.704114<\/span><span id=\"4c72\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">cad_to_gbp <strong class=\"lp km\">=<\/strong> 0.573651<\/span><span id=\"aae4\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">cad_to_euro <strong class=\"lp km\">=<\/strong> 0.651656<\/span><span id=\"a62e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">cad_to_mxn <strong class=\"lp km\">=<\/strong> 17.5915<\/span><span id=\"945c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">min_raw_price_to_show_on_amazon <strong class=\"lp km\">=<\/strong> 10<\/span><\/pre>\n<p id=\"c832\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [ ]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"32f0\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># adjust for the case that shipping rate\/cost may change<\/em><\/span><\/pre>\n<p id=\"4f23\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [36]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"6ca5\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># D2 = price_calculation_df['raw_price'] = raw_df['']<\/em><\/span><span id=\"1299\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># price_calculation_df['cheapest_courier_shipping'].where<\/em><\/span><span id=\"33fe\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">H2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Ship Risk'] <strong class=\"lp km\">=<\/strong> F2 <strong class=\"lp km\">*<\/strong> ship_risk_percent <em class=\"lt\">#price_calculation_df['raw_price']<\/em><\/span><span id=\"e971\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_calculation_df['Ship Risk'][:5]<\/span><\/pre>\n<p id=\"5a3a\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[36]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"79c5\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">0    15.0\n1    15.0\n2    15.0\n3    15.0\n4    15.0\nName: Ship Risk, dtype: float64<\/span><\/pre>\n<p id=\"f694\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [ ]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"bf9a\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">H2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Ship Risk'] <strong class=\"lp km\">=<\/strong> F2 <strong class=\"lp km\">*<\/strong> ship_risk_percent <em class=\"lt\">#price_calculation_df['raw_price']<\/em><\/span><\/pre>\n<p id=\"ad1b\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [37]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"8113\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># adjust for the case that supplier price  may change<\/em><\/span><span id=\"0ea2\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">I2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Price Risk'] <strong class=\"lp km\">=<\/strong> price_calculation_df['raw_price'] <strong class=\"lp km\">*<\/strong> price_risk_percent<\/span><\/pre>\n<p id=\"9973\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [38]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"fdfa\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># calculate total product price so far<\/em><\/span><span id=\"4ea9\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">J2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Total'] <strong class=\"lp km\">=<\/strong> round(D2 <strong class=\"lp km\">+<\/strong> F2 <strong class=\"lp km\">+<\/strong> H2 <strong class=\"lp km\">+<\/strong> I2,2) <em class=\"lt\">#price_calculation_df['raw_price'] + price_calculation_df['Ship Risk'] + price_calculation_df['Price Risk']<\/em><\/span><\/pre>\n<p id=\"7bd7\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[38]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"21ed\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">(0    12.90\n 1    13.61\n 2    10.20\n 3    10.12\n 4    10.96\n Name: raw_price, dtype: float64, 0    500.0\n 1    500.0\n 2    500.0\n 3    500.0\n 4    500.0\n Name: cheapest_courier_shipping, dtype: float64, 0    500.0\n 1    500.0\n 2    500.0\n 3    500.0\n 4    500.0\n Name: cheapest_courier_shipping, dtype: float64, 0    15.0\n 1    15.0\n 2    15.0\n 3    15.0\n 4    15.0\n Name: cheapest_courier_shipping, dtype: float64, 0    0.3870\n 1    0.4083\n 2    0.3060\n 3    0.3036\n 4    0.3288\n Name: raw_price, dtype: float64, 0    528.29\n 1    529.02\n 2    525.51\n 3    525.42\n 4    526.29\n dtype: float64)<\/span><\/pre>\n<p id=\"3261\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [39]:<\/p>\n<blockquote class=\"tk tl tm\">\n<p id=\"5057\" class=\"jy jz ap lt ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"><em class=\"by\"># verify the total price so far<\/em><\/p>\n<\/blockquote>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"a085\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">price_calculation_df['raw_price'][:5], F2[:5], price_calculation_df['cheapest_courier_shipping'][:5], H2[:5], I2[:5], J2[:5]<\/span><\/pre>\n<p id=\"768a\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[39]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"4860\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">(0    12.90\n 1    13.61\n 2    10.20\n 3    10.12\n 4    10.96\n Name: raw_price, dtype: float64, 0    500.0\n 1    500.0\n 2    500.0\n 3    500.0\n 4    500.0\n Name: cheapest_courier_shipping, dtype: float64, 0    500.0\n 1    500.0\n 2    500.0\n 3    500.0\n 4    500.0\n Name: cheapest_courier_shipping, dtype: float64, 0    15.0\n 1    15.0\n 2    15.0\n 3    15.0\n 4    15.0\n Name: cheapest_courier_shipping, dtype: float64, 0    0.3870\n 1    0.4083\n 2    0.3060\n 3    0.3036\n 4    0.3288\n Name: raw_price, dtype: float64, 0    528.29\n 1    529.02\n 2    525.51\n 3    525.42\n 4    526.29\n dtype: float64)<\/span><\/pre>\n<p id=\"d2dc\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [40]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"2722\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># adjust for the case that some products will be returned back. Account for related expenses<\/em><\/span><\/pre>\n<p id=\"f0b6\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [41]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"782a\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#price_calculation_df['Risk Return'] = []<\/em><\/span><span id=\"90bc\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">risk_return <strong class=\"lp km\">=<\/strong> []<\/span><span id=\"d88a\" 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> aPrice <strong class=\"lp km\">in<\/strong> F2:<\/span><span id=\"b95e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#print(float(aPrice) * return_risk_percent)<\/em><\/span><span id=\"b0eb\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">try<\/strong>:<\/span><span id=\"9b70\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">risk_amount <strong class=\"lp km\">=<\/strong> float(aPrice) <strong class=\"lp km\">*<\/strong> return_risk_percent<\/span><span id=\"3ccb\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">risk_amount <strong class=\"lp km\">=<\/strong> round(risk_amount, 2)<\/span><span id=\"db65\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">except<\/strong>:<\/span><span id=\"717c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">risk_amount <strong class=\"lp km\">=<\/strong> max_return_amount<\/span><span id=\"1925\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">if<\/strong> risk_amount  <strong class=\"lp km\">&lt;<\/strong> max_return_amount:<\/span><span id=\"4ce0\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">risk_return.append(  risk_amount )<\/span><span id=\"827e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><strong class=\"lp km\">else<\/strong>:<\/span><span id=\"dcb1\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">risk_return.append(max_return_amount)<\/span><span id=\"c57c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_calculation_df['Risk Return'] <strong class=\"lp km\">=<\/strong> risk_return<\/span><span id=\"4494\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">K2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Risk Return'] <em class=\"lt\">#= 10 #sorted([ int(price_calculation_df['cheapest_courier_shipping']), 10 ] )[1]<\/em><\/span><span id=\"b765\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">K2 <strong class=\"lp km\">=<\/strong> risk_return<\/span><span id=\"0f3d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">K2[:5]<\/span><\/pre>\n<p id=\"4c8a\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[41]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"09b9\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">[20, 20, 20, 20, 20]<\/span><\/pre>\n<p id=\"b97d\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [42]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"326d\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># calculate your total cost (also how it affects your selling price) considering various factors<\/em><\/span><\/pre>\n<p id=\"0909\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [43]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"adc1\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">L2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">=<\/strong> round(J2 <strong class=\"lp km\">+<\/strong> K2, 2) <em class=\"lt\">#price_calculation_df['Total'] +  price_calculation_df['Risk Return']<\/em><\/span><span id=\"a4d6\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">L2[:5]<\/span><span id=\"7bc3\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">M2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Referral Fee'] <strong class=\"lp km\">=<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">*<\/strong> referral_rate<\/span><span id=\"8fcb\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">N2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Paypal Fees'] <strong class=\"lp km\">=<\/strong> 0.30 <strong class=\"lp km\">+<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">*<\/strong> paypal_fee_rate<\/span><span id=\"83fe\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">O2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Final Value Fee'] <strong class=\"lp km\">=<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">*<\/strong>  final_value_fee_rate<\/span><span id=\"07e0\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">P2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Insertion Fee'] <strong class=\"lp km\">=<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">*<\/strong> insertion_fee_rate<\/span><span id=\"f5b8\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">Q2 <strong class=\"lp km\">=<\/strong> price_calculation_df['HST'] <strong class=\"lp km\">=<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">*<\/strong> hst_rate<\/span><span id=\"19a1\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">R2 <strong class=\"lp km\">=<\/strong> price_calculation_df['EU Vat'] <strong class=\"lp km\">=<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">*<\/strong> eu_vat_rate<\/span><span id=\"32bd\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">S2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Currency Risk'] <strong class=\"lp km\">=<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">*<\/strong> currency_risk<\/span><span id=\"fcc0\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">T2 <strong class=\"lp km\">=<\/strong> price_calculation_df['shopforsoul_profit'] <strong class=\"lp km\">=<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">*<\/strong> sfs_profit<\/span><span id=\"bccb\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#ebay_profit = 0.20<\/em><\/span><span id=\"3e5f\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">U2 <strong class=\"lp km\">=<\/strong> price_calculation_df['ebay_profit'] <strong class=\"lp km\">=<\/strong> price_calculation_df['Total with ship'] <strong class=\"lp km\">*<\/strong> ebay_profit<\/span><span id=\"11b6\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#income_tax = 0.20<\/em><\/span><span id=\"cfd6\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">V2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Income Tax'] <strong class=\"lp km\">=<\/strong> price_calculation_df['shopforsoul_profit'] <strong class=\"lp km\">*<\/strong> income_tax<\/span><span id=\"5949\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">M2[:5], V2[:5], U2[:5]<\/span><\/pre>\n<p id=\"c62c\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">Out[43]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"e503\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">(0    54.829\n 1    54.902\n 2    54.551\n 3    54.542\n 4    54.629\n Name: Total with ship, dtype: float64, 0    27.4145\n 1    27.4510\n 2    27.2755\n 3    27.2710\n 4    27.3145\n Name: shopforsoul_profit, dtype: float64, 0    109.658\n 1    109.804\n 2    109.102\n 3    109.084\n 4    109.258\n Name: Total with ship, dtype: float64)<\/span><\/pre>\n<p id=\"c7c2\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [44]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"7edb\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># Output price (and related) for your magento or similar based retail shop<\/em><\/span><span id=\"d4ba\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\"># sale\/special prices and dates<\/em><\/span><\/pre>\n<p id=\"48d6\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">In [45]:<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"1720\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\">W2 <strong class=\"lp km\">=<\/strong> price_calculation_df['shopforsoul_cost'] <strong class=\"lp km\">=<\/strong> round(L2<strong class=\"lp km\">+<\/strong>M2<strong class=\"lp km\">+<\/strong>N2<strong class=\"lp km\">+<\/strong>P2<strong class=\"lp km\">+<\/strong>S2<strong class=\"lp km\">+<\/strong>V2,2)<\/span><span id=\"f31a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"><em class=\"lt\">#W2 = price_calculation_df['shopforsoul_cost']<\/em><\/span><span id=\"5128\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">X2 <strong class=\"lp km\">=<\/strong> price_calculation_df['MLP'] <strong class=\"lp km\">=<\/strong> round(W2<strong class=\"lp km\">+<\/strong>T2,2)<\/span><span id=\"0e49\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">Y2 <strong class=\"lp km\">=<\/strong> price_calculation_df['Special List Price'] <strong class=\"lp km\">=<\/strong> round(W2<strong class=\"lp km\">+<\/strong>L2<strong class=\"lp km\">*<\/strong>sfs_special_profit,2)<\/span><span id=\"0bfb\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">Z2 <strong class=\"lp km\">=<\/strong> price_calculation_df['special_from_date'] <strong class=\"lp km\">=<\/strong> special_from_date<\/span><span id=\"1b40\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">special_to_date <strong class=\"lp km\">=<\/strong> '2020-12-31'<\/span><span id=\"4b2b\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">AA2 <strong class=\"lp km\">=<\/strong> price_calculation_df['special_to_date'] <strong class=\"lp km\">=<\/strong> special_to_date<\/span><\/pre>\n<p id=\"9060\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\">All Code in One Block. You might still need to adjust the indent<\/p>\n<p id=\"63f5\" class=\"jy jz ap by ka b kb kc kd ke kf kg kh ki kj kk kl fr\" data-selectable-paragraph=\"\"># # Section Data Upload for Magento 2<\/p>\n<pre class=\"lh li lj lk ll hz lm fi\"><span id=\"1392\" class=\"ln lo ap by lp b cp lq lr r ls\" data-selectable-paragraph=\"\"># In[1]:<\/span><span id=\"33ab\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">import pandas as pd<\/span><span id=\"59c9\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[2]:<\/span><span id=\"f423\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># output file will be dated\nfrom datetime import date;\ntoday = date.today()\ntoday = today.strftime(\u201c%Y-%m-%d\u201d)\ntoday<\/span><span id=\"f54c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[3]:<\/span><span id=\"504a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">data_folder = \u2018data-supplier-2020\u201304\u201314\/\u2019;\ntemplate_folder = \u2018.\/templates\/\u2019<\/span><span id=\"e4fa\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[4]:<\/span><span id=\"fa91\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">input_file_name = \u2018all_supplier_data_unique_sorted_and_filtered.csv\u2019;\nraw_file = data_folder + input_file_name;\nraw_file<\/span><span id=\"21ad\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[6]:<\/span><span id=\"61bd\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># read data from the combined sorted filtered file\nraw_df = pd.read_csv(raw_file)\nraw_df.head(2)<\/span><span id=\"d759\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[7]:<\/span><span id=\"96ec\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># check product price and columns\nraw_df[:1][\u20181pc Price\u2019], raw_df.shape, raw_df.columns<\/span><span id=\"680f\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[10]:<\/span><span id=\"39a2\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># Now, sell prices and related will be calculated including sell prices for amazon and ebay \n# The output column names are kept in a csv file.\n# Reading the column names from that template file\nprice_calculation_template_file = template_folder + \u2018price_calculations_template.csv\u2019\nprice_calculation_template = pd.read_csv(price_calculation_template_file)\nprice_calculation_template.head(), price_calculation_template.columns<\/span><span id=\"6b6e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[ ]:<\/span><span id=\"e4f4\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">#price_calculation_template.columns<\/span><span id=\"9b00\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[ ]:<\/span><span id=\"c070\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">#raw_df.columns, price_calculation_template.columns<\/span><span id=\"227d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[11]:<\/span><span id=\"6794\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># create a dataframe to store the prices\nprice_calculation_df = pd.DataFrame()<\/span><span id=\"d222\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[12]:<\/span><span id=\"3a05\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># take some column value as is : This block is not used any more\n\u201c\u201d\u201d\nprice_calculation_df[\n [\n \u2018product_id\u2019, \n \u2018sku\u2019, \n \u2018Name\u2019,\n \u2018raw_price\u2019, \n \u2018Postal Shipping Price\u2019,\n \u2018cheapest_courier_shipping\u2019, \n \u2018product_ean\u2019\n ]\n ] = raw_df[\n [\n \u2018Product ID\u2019, \n \u2018Model Code\u2019, \n \u2018Full Product Name\u2019, \n \u20181pc Price\u2019, \n \u20181pc Cheapest Postal Shipping Price\u2019,\n \u20181pc Cheapest Express Courier Shipping Price\u2019, \n \u2018EAN\u2019 \n ]\n ]<\/span><span id=\"c8b5\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">\u201c\u201d\u201d<\/span><span id=\"0854\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[ ]:<\/span><span id=\"f57f\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># take some columns from the raw input dataframe to the output price calculation data frame\n# The terms A2, B2, C2 were used for a reason. Previously the calulations were being done in Excel and later converted to\n# Python code. To make the conversion easy, the cell names are kept intact. You can modify i.e. replace A2, B2, C2 with names you like, \n# you can even remove them and adjust the code with dataframe columns<\/span><span id=\"3b2e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[13]:<\/span><span id=\"7b9a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># keep product id as is\nA2 = price_calculation_df[\u2018product_id\u2019] = raw_df[\u2018Product ID\u2019]<\/span><span id=\"eee0\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># modify product sku\nB2 = price_calculation_df[\u2018sku\u2019] = \u2018shopforsoul-\u2019 + raw_df[\u2018Model Code\u2019]<\/span><span id=\"6731\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># create product name. added code to the name. this might for verification purpose such as to refer to the supplier\nC2 = price_calculation_df[\u2018Name\u2019] = raw_df[\u2018Full Product Name\u2019] + \u2018-\u2019 + raw_df[\u2018Model Code\u2019]\nD2 = price_calculation_df[\u2018raw_price\u2019] = raw_df[\u20181pc Price\u2019]\nE2 = price_calculation_df[\u2018Postal Shipping Price\u2019] = raw_df[\u20181pc Cheapest Postal Shipping Price\u2019]\nF2 = price_calculation_df[\u2018cheapest_courier_shipping\u2019] = raw_df[\u20181pc Cheapest Express Courier Shipping Price\u2019]\nG2 = price_calculation_df[\u2018product_ean\u2019] = raw_df[\u2018EAN\u2019]\n#price_calculation_df[\u2018product_ean\u2019] [:-3]<\/span><span id=\"645d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[14]:<\/span><span id=\"aeb9\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">list(price_calculation_df[\u2018Name\u2019][:1])<\/span><span id=\"bab4\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[16]:<\/span><span id=\"8c4d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">raw_df[\u20181pc Cheapest Postal Shipping Price\u2019][:2]<\/span><span id=\"1b67\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[21]:<\/span><span id=\"54fa\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># adjust cheapest_courier_shipping as supplied by supplier<\/span><span id=\"6268\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[22]:<\/span><span id=\"d367\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># bring all F2 processing : cheapest_courier_shipping : replace no with $500 i.e. dificult and do not want to sell\nF2 = F2.replace(\u2018NaN\u2019,\u2019500')\nF2 = F2.replace(\u2018nan\u2019,\u2019500')<\/span><span id=\"060f\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[23]:<\/span><span id=\"726d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">#F2.unique()\n#No Courier Shipping Available, replace with 500\n#F2 = price_calculation_df[\u2018cheapest_courier_shipping\u2019] = F2.replace(\u2018No Courier Shipping Available\u2019,\u2019500')#.astype(float)\nF2 = price_calculation_df[\u2018cheapest_courier_shipping\u2019] = F2.replace(\u2018No Postal Shipping Available\u2019,\u2019500')#.astype(float)\nF2 = price_calculation_df[\u2018cheapest_courier_shipping\u2019] = F2.astype(float)\nF2 = price_calculation_df[\u2018cheapest_courier_shipping\u2019] = price_calculation_df[\u2018cheapest_courier_shipping\u2019].replace(\u2018,\u2019,\u2019\u2019)<\/span><span id=\"5c9c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[24]:<\/span><span id=\"d4c7\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">price_calculation_df[\u2018cheapest_courier_shipping\u2019][:5]<\/span><span id=\"49c4\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[25]:<\/span><span id=\"4a3e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># adjust cheapest_courier_shipping as provided by the supplier<\/span><span id=\"f969\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[26]:<\/span><span id=\"0b3d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">E2 = price_calculation_df[\u2018Postal Shipping Price\u2019] = E2.replace(\u2018No Postal Shipping Available\u2019,\u2019500')\nE2 = price_calculation_df[\u2018Postal Shipping Price\u2019] = E2.astype(float)\nE2 = price_calculation_df[\u2018Postal Shipping Price\u2019] = price_calculation_df[\u2018Postal Shipping Price\u2019].replace(\u2018,\u2019,\u2019\u2019)<\/span><span id=\"555a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[28]:<\/span><span id=\"e547\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">sorted(F2, reverse=True)[:5]<\/span><span id=\"8b3a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[30]:<\/span><span id=\"12ea\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># check the output file so far\nprice_calculation_df.head(2)<\/span><span id=\"0fcd\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[31]:<\/span><span id=\"c08b\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># adjust product EAN. Product EAN are matched with Amazon to find the Amazon Product ID : ASIN\nG2 = price_calculation_df[\u2018product_ean\u2019] = price_calculation_df[\u2018product_ean\u2019].astype(str)\nprice_calculation_df[\u2018product_ean\u2019][:4]<\/span><span id=\"81e5\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[32]:<\/span><span id=\"48a7\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">type(F2)<\/span><span id=\"9e3d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[33]:<\/span><span id=\"f9f5\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># define some constants to calculate your target price such as currency rates, shipping risk, hst, your tax burden<\/span><span id=\"7165\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[34]:<\/span><span id=\"4e6e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">ship_risk_percent = 0.001\nprice_risk_percent = 0.001\nreturn_risk_percent = 0.001\nmax_return_amount = 0.001\nreferral_rate = 0.001\npaypal_fee_rate = 0.001\nfinal_value_fee_rate = 0.001\ninsertion_fee_rate = 0.001\nhst_rate = 0.001\neu_vat_rate = 0.001\ncurrency_risk = 0.001\nsfs_profit = 0.001\nebay_profit = 0.001\nincome_tax = 0.001\nsfs_special_profit = 0.001\nspecial_from_date = \u20182020\u201304\u201303\u2019\nspecial_to_date = \u20182020\u201306\u201330\u2019\namazon_final_fee_rate = 0.001\namazon_profit = 0.001\namazon_special_profit = 0.001\ncad_to_usd = 0.704114\ncad_to_gbp = 0.573651\ncad_to_euro = 0.651656\ncad_to_mxn = 17.5915\nmin_raw_price_to_show_on_amazon = 0.001<\/span><span id=\"60d0\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[ ]:<\/span><span id=\"1930\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># adjust for the case that shipping rate\/cost may change<\/span><span id=\"053b\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[36]:<\/span><span id=\"5386\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># D2 = price_calculation_df[\u2018raw_price\u2019] = raw_df[\u2018\u2019]\n# price_calculation_df[\u2018cheapest_courier_shipping\u2019].where\nH2 = price_calculation_df[\u2018Ship Risk\u2019] = F2 * ship_risk_percent #price_calculation_df[\u2018raw_price\u2019]\nprice_calculation_df[\u2018Ship Risk\u2019][:5]<\/span><span id=\"4d8c\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[ ]:<\/span><span id=\"2571\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">H2 = price_calculation_df[\u2018Ship Risk\u2019] = F2 * ship_risk_percent #price_calculation_df[\u2018raw_price\u2019]<\/span><span id=\"56ec\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[37]:<\/span><span id=\"4c04\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># adjust for the case that supplier price may change\nI2 = price_calculation_df[\u2018Price Risk\u2019] = price_calculation_df[\u2018raw_price\u2019] * price_risk_percent<\/span><span id=\"49c5\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[38]:<\/span><span id=\"8b6d\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># calculate total product price so far\nJ2 = price_calculation_df[\u2018Total\u2019] = round(D2 + F2 + H2 + I2,2) #price_calculation_df[\u2018raw_price\u2019] + price_calculation_df[\u2018Ship Risk\u2019] + price_calculation_df[\u2018Price Risk\u2019]<\/span><span id=\"f3ca\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[39]:<\/span><span id=\"59f7\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># verify the total price so far\nprice_calculation_df[\u2018raw_price\u2019][:5], F2[:5], price_calculation_df[\u2018cheapest_courier_shipping\u2019][:5], H2[:5], I2[:5], J2[:5]<\/span><span id=\"84ab\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[40]:<\/span><span id=\"31ee\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># adjust for the case that some products will be returned back. Account for related expenses<\/span><span id=\"e97a\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[41]:<\/span><span id=\"30c5\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">#price_calculation_df[\u2018Risk Return\u2019] = []\nrisk_return = []\nfor aPrice in F2:\n #print(float(aPrice) * return_risk_percent)\n try:\n risk_amount = float(aPrice) * return_risk_percent\n risk_amount = round(risk_amount, 2)\n except:\n risk_amount = max_return_amount\n \n \n if risk_amount &lt; max_return_amount:\n risk_return.append( risk_amount )\n else:\n risk_return.append(max_return_amount)\n \nprice_calculation_df[\u2018Risk Return\u2019] = risk_return\nK2 = price_calculation_df[\u2018Risk Return\u2019] #= 10 #sorted([ int(price_calculation_df[\u2018cheapest_courier_shipping\u2019]), 10 ] )[1]\nK2 = risk_return\nK2[:5]<\/span><span id=\"8ebf\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[42]:<\/span><span id=\"48f4\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># calculate your total cost (also how it affects your selling price) considering various factors<\/span><span id=\"47f0\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[43]:<\/span><span id=\"152e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">L2 = price_calculation_df[\u2018Total with ship\u2019] = round(J2 + K2, 2) #price_calculation_df[\u2018Total\u2019] + price_calculation_df[\u2018Risk Return\u2019]\nL2[:5]\nM2 = price_calculation_df[\u2018Referral Fee\u2019] = price_calculation_df[\u2018Total with ship\u2019] * referral_rate\nN2 = price_calculation_df[\u2018Paypal Fees\u2019] = 0.30 + price_calculation_df[\u2018Total with ship\u2019] * paypal_fee_rate<\/span><span id=\"7002\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">O2 = price_calculation_df[\u2018Final Value Fee\u2019] = price_calculation_df[\u2018Total with ship\u2019] * final_value_fee_rate\nP2 = price_calculation_df[\u2018Insertion Fee\u2019] = price_calculation_df[\u2018Total with ship\u2019] * insertion_fee_rate\nQ2 = price_calculation_df[\u2018HST\u2019] = price_calculation_df[\u2018Total with ship\u2019] * hst_rate \nR2 = price_calculation_df[\u2018EU Vat\u2019] = price_calculation_df[\u2018Total with ship\u2019] * eu_vat_rate\nS2 = price_calculation_df[\u2018Currency Risk\u2019] = price_calculation_df[\u2018Total with ship\u2019] * currency_risk \nT2 = price_calculation_df[\u2018shopforsoul_profit\u2019] = price_calculation_df[\u2018Total with ship\u2019] * sfs_profit\n#ebay_profit = 0.20\nU2 = price_calculation_df[\u2018ebay_profit\u2019] = price_calculation_df[\u2018Total with ship\u2019] * ebay_profit\n#income_tax = 0.20\nV2 = price_calculation_df[\u2018Income Tax\u2019] = price_calculation_df[\u2018shopforsoul_profit\u2019] * income_tax\nM2[:5], V2[:5], U2[:5]<\/span><span id=\"17d8\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[44]:<\/span><span id=\"bdbf\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># Output price (and related) for your magento or similar based retail shop\n# sale\/special prices and dates<\/span><span id=\"aaf3\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\"># In[45]:<\/span><span id=\"cc8e\" class=\"ln lo ap by lp b cp lu lv lw lx ly lr r ls\" data-selectable-paragraph=\"\">W2 = price_calculation_df[\u2018shopforsoul_cost\u2019] = round(L2+M2+N2+P2+S2+V2,2)\n#W2 = price_calculation_df[\u2018shopforsoul_cost\u2019]\nX2 = price_calculation_df[\u2018MLP\u2019] = round(W2+T2,2)\nY2 = price_calculation_df[\u2018Special List Price\u2019] = round(W2+L2*sfs_special_profit,2)\nZ2 = price_calculation_df[\u2018special_from_date\u2019] = special_from_date\nspecial_to_date = \u20182020\u201312\u201331\u2019\nAA2 = price_calculation_df[\u2018special_to_date\u2019] = special_to_date<\/span><\/pre>\n<p id=\"f72e\" 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\">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=\"c199\" 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=\"7d4f\" 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=\"d958\" 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=\"de6b\" 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=\"c022\" 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=\"26cb\" 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=\"2c33\" 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=\"666e\" 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=\"c872\" 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=\"4e40\" 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=\"9d5b\" 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=\"6001\" 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=\"cd27\" 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=\"806\" aria-labelledby=\"806\">\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=\"807\" aria-labelledby=\"807\"><\/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\/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\/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\/dataprocessing\">Dataprocessing<\/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\/laravel\">Laravel<\/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=\"808\" aria-labelledby=\"808\">\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=\"809\" aria-labelledby=\"809\"><\/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 class=\"pe he r y\">\n<div class=\"hz pi ds r pj g\"><span class=\"ha\">Write the first response<\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The requirements for each of the sales channel can be different such as for Ebay you might want to calculate Paypal fees; for Amazon you have to check for Amazon fees. For your own retail site, shipping cost might need different calculation as well as based on your target audience tax\/hst will affect the price. &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=17005\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1912,1852,182],"tags":[],"class_list":["post-17005","post","type-post","status-publish","format-standard","hentry","category-build-ecommerce-software","category-laravel","category---blog","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":17006,"url":"http:\/\/bangla.sitestree.com\/?p=17006","url_meta":{"origin":17005,"position":0},"title":"Python: Ecommerce: Part \u2014 5: Calculate Your Sell Prices for Ebay and Amazon","author":"Sayed","date":"April 19, 2020","format":false,"excerpt":"Please read the other articles for this series. Code will be given cell by cell from Jupyter Notebook. Then will also give all code in one block. You might need to adjust the indenting a bit. Read the code comments as well. Comments explained the sections. Calculate sell prices (and\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":17009,"url":"http:\/\/bangla.sitestree.com\/?p=17009","url_meta":{"origin":17005,"position":1},"title":"Python: Ecommerce: Part \u2014 8: Calculate Minimum and Maximum Prices for your products.","author":"Sayed","date":"April 19, 2020","format":false,"excerpt":"Related Build Ecommerce Software and Systems Build Ecommerce Software and Systemsmedium.com To make sure, when you adjust prices based on other sellers, you will not lose money. You can upload such files on Amazon Separately. Min and max price calculation. This is done for UK\/GBP. You can do the same\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":67572,"url":"http:\/\/bangla.sitestree.com\/?p=67572","url_meta":{"origin":17005,"position":2},"title":"Ecommerce related Plugins Explored and\/or used #ecommerce","author":"Author-Check- Article-or-Video","date":"July 25, 2021","format":false,"excerpt":"Ecommerce related Plugins Explored (primarily) and\/or used \u00a0 To integrate with the DropShip functionality of DealExtreme (I do not know if DealExtreme is reliable or not): http:\/\/xml-import.eu\/dealextreme-dropshipping-integration\/ \u00a0 Synchronize Magento with Amazon: products, stock levels, sales and shipments. https:\/\/www.magentocommerce.com\/magento-connect\/amazon-1.html \u00a0 Import Amazon products to Magento https:\/\/web-experiment.info\/magento-amazon-products-manager \u00a0 eBay-Amazon-Rakuten-Magento Integration -\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":17007,"url":"http:\/\/bangla.sitestree.com\/?p=17007","url_meta":{"origin":17005,"position":3},"title":"Python: Ecommerce: Part \u2014 6: Format and adjust your product data and price data to save to a csv to upload to  Magento 2.","author":"Sayed","date":"April 19, 2020","format":false,"excerpt":"Code will be given cell by cell from Jupyter Notebook. Then will also give all code in one block. You might need to adjust the indenting a bit. Read the code comments as well. Comments explained the sections. In [86]: # calculate\/adjust data so that we can create magento 2\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":17346,"url":"http:\/\/bangla.sitestree.com\/?p=17346","url_meta":{"origin":17005,"position":4},"title":"Amazon Selling, Ecommerce, Inventory, Product Management, Product Database Articles","author":"Sayed","date":"August 13, 2020","format":false,"excerpt":"Misc. Stored Procedures as Used to Manage Products, Product Pricing for a Amazon Store: http:\/\/bangla.salearningschool.com\/recent-posts\/category\/selling-on-amazon\/ Python Code to import supplier product data to Magento. Including Price Calculations. http:\/\/bangla.salearningschool.com\/recent-posts\/category\/build-ecommerce-software\/ Ecommerce shop development: https:\/\/www.youtube.com\/watch?v=T8RqjC_iQqM&list=PLUA7SYgJYDFqOx7--ezlbukRbVX1wIfeI Amazon Product Management Database: https:\/\/www.youtube.com\/watch?v=qrbMO5W9uYw&list=PLUA7SYgJYDFryEwISZ2jrnbJf0wCBKrxQ Online\/Ecommerce Product and Pricing Database: http:\/\/www.shopforsoul.com\/ *** . *** *** . *** .\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":17005,"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\/17005","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\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17005"}],"version-history":[{"count":2,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/17005\/revisions"}],"predecessor-version":[{"id":17028,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/17005\/revisions\/17028"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17005"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}