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 upload files
# csv file to upload to Magento 2
In [88]:
# load the template : i.e. columns required for magento 2 upload
magento_2_upload_template_file = template_folder + 'magento2_catalog_product.csv' #'all-to-upload-without-description.csv'magento_2_upload_template_file = pd.read_csv(magento_2_upload_template_file)
In [89]:
magento_2_upload_template_file.columns
Out[89]:
Index(['sku', 'store_view_code', 'attribute_set_code', 'product_type',
'categories', 'product_websites', 'name', 'description',
'short_description', 'weight', 'product_online', 'tax_class_name',
'visibility', 'price', 'special_price', 'special_price_from_date',
'special_price_to_date', 'url_key', 'meta_title', 'meta_keywords',
'meta_description', 'created_at', 'updated_at', 'new_from_date',
'new_to_date', 'display_product_options_in', 'map_price', 'msrp_price',
'map_enabled', 'gift_message_available', 'custom_design',
'custom_design_from', 'custom_design_to', 'custom_layout_update',
'page_layout', 'product_options_container',
'msrp_display_actual_price_type', 'country_of_manufacture',
'additional_attributes', 'qty', 'out_of_stock_qty',
'use_config_min_qty', 'is_qty_decimal', 'allow_backorders',
'use_config_backorders', 'min_cart_qty', 'use_config_min_sale_qty',
'max_cart_qty', 'use_config_max_sale_qty', 'is_in_stock',
'notify_on_stock_below', 'use_config_notify_stock_qty', 'manage_stock',
'use_config_manage_stock', 'use_config_qty_increments',
'qty_increments', 'use_config_enable_qty_inc', 'enable_qty_increments',
'is_decimal_divided', 'website_id', 'deferred_stock_update',
'use_config_deferred_stock_update', 'related_skus', 'crosssell_skus',
'upsell_skus', 'hide_from_product_page', 'custom_options',
'bundle_price_type', 'bundle_sku_type', 'bundle_price_view',
'bundle_weight_type', 'bundle_values', 'associated_skus'],
dtype='object')
In [90]:
price_calculation_df.columns
Out[90]:
Index(['product_id', 'sku', 'Name', 'raw_price', 'Postal Shipping Price',
'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_profit', 'amazon_our_cost', 'Amazon Final Value Fee',
'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',
'original in stock', 'Stock status', 'categories', '_root_category',
'visibility', 'Height mm', 'Width mm', 'Depth mm', 'status',
'weight right', 'Ship Right', 'Soon Discontinued', 'Is Normal',
'Retail Price', 'R+shipp', 'Shop vs retail', 'amazon_ca_minimum_price',
'amazon_usd_minimum_price', 'amazon_gbp_minimum_price',
'amazon_eu_minimum_price', 'amazon_mxn_minimum', 'expedited_cost',
'amazon_ca_abs_minimum'],
dtype='object')
In [91]:
price_calculation_df.rename(columns={'Height mm': 'height'}, inplace=True)price_calculation_df.rename(columns={'Depth mm': 'length', 'Width mm': 'width'}, inplace=True)price_calculation_df.rename(columns={'Special List Price':'special_price', 'MLP':'price', 'Stock status':'is_in_stock'}, inplace=True)#amazon_our_cost_usdprice_calculation_df.rename(columns={'Name':'name', 'Weight':'weight'}, inplace=True) #, 'use_config_min_qty', 'visibility'
In [92]:
# set some default values that you want to upload to Magento 2
# default values are in list format so that it can be aligned with other data
In [93]:
type = ['simple'] * price_calculation_df.shape[0]_attribute_set = ['Default'] * price_calculation_df.shape[0]qty = [10] * price_calculation_df.shape[0]min_qty = [1] * price_calculation_df.shape[0]use_config_min_qty = [1] * price_calculation_df.shape[0]is_qty_decimal = [0] * price_calculation_df.shape[0]backorders = [0] * price_calculation_df.shape[0]use_config_backorders = [1] * price_calculation_df.shape[0]min_sale_qty = [1] * price_calculation_df.shape[0]use_config_min_sale_qty = [1] * price_calculation_df.shape[0]max_sale_qty = [2] * price_calculation_df.shape[0]use_config_max_sale_qty = [1] * price_calculation_df.shape[0]notify_stock_qty = [0] * price_calculation_df.shape[0]use_config_notify_stock_qty = [1] * price_calculation_df.shape[0]manage_stock = [0] * price_calculation_df.shape[0]use_config_manage_stock = [1] * price_calculation_df.shape[0]stock_status_changed_auto = [0] * price_calculation_df.shape[0]use_config_qty_increments = [1] * price_calculation_df.shape[0]qty_increments = [0] * price_calculation_df.shape[0]use_config_enable_qty_inc = [1] * price_calculation_df.shape[0]enable_qty_increments = [0] * price_calculation_df.shape[0]is_decimal_divided = [0] * price_calculation_df.shape[0]_media_is_disabled = [0] * price_calculation_df.shape[0]tax_class_id = [2] * price_calculation_df.shape[0]
In [94]:
# creating dataframe to store data to upload to Magento 2
# this dataframe will be saved to a csv file
In [95]:
magento_2_upload_file_with_data_no_desc = price_calculation_df[['sku',#'store_view_code',#'attribute_set_code',#'product_type',#'categories',#'product_websites', 'name',#'description',#'short_description','weight',#'product_online',#'tax_class_name',#'visibility','price','special_price',#'special_price_from_date',#'special_price_to_date',#'url_key',#'meta_title',#'meta_keywords',#'meta_description',#'created_at',#'updated_at',#'new_from_date',#'new_to_date',#'display_product_options_in',#'map_price', 'msrp_price',#'map_enabled',#'gift_message_available',#'custom_design',#'custom_design_from',#'custom_design_to',#'custom_layout_update',#'page_layout',#'product_options_container',#'msrp_display_actual_price_type',#'country_of_manufacture',#'additional_attributes',#'qty',#'out_of_stock_qty',#'use_config_min_qty',#'is_qty_decimal',#'allow_backorders',#'use_config_backorders',#'min_cart_qty',#'use_config_min_sale_qty',#'max_cart_qty',#'use_config_max_sale_qty','is_in_stock',#'notify_on_stock_below',#'use_config_notify_stock_qty',#'manage_stock',#'use_config_manage_stock',#'use_config_qty_increments',#'qty_increments',#'use_config_enable_qty_inc',#'enable_qty_increments',#'is_decimal_divided',#'website_id',#'deferred_stock_update',#'use_config_deferred_stock_update',#'related_skus',#'crosssell_skus',#'upsell_skus',#'hide_from_product_page',#'custom_options',#'bundle_price_type', 'bundle_sku_type', 'bundle_price_view',#'bundle_weight_type', 'bundle_values', 'associated_skus']]magento_2_upload_file_with_data_no_desc = price_calculation_df[['product_id', 'sku', 'name', 'raw_price',#'dummy','cheapest_courier_shipping', 'product_ean', 'shopforsoul_profit','ebay_profit', 'shopforsoul_cost', 'price', 'special_price','special_from_date', 'special_to_date', 'ebay_cost', 'ebay_list_price','amazon_profit','amazon_our_cost', 'amazon_list_price','amazon_special_price', 'amazon_list_price_usd','amazon_special_price_usd', 'amazon_list_price_gbp','amazon_special_price_gbp', 'amazon_list_price_eu','amazon_special_price_eu', 'weight', 'is_in_stock', 'categories',#'_root_category','visibility','height', 'width','length','status',#'_type', '_attribute_set', 'qty', 'min_qty',#'use_config_min_qty',#'is_qty_decimal', 'backorders',#'use_config_backorders', 'min_sale_qty', 'use_config_min_sale_qty',#'max_sale_qty', 'use_config_max_sale_qty', 'notify_stock_qty',#'use_config_notify_stock_qty', 'manage_stock',#'use_config_manage_stock', 'stock_status_changed_auto',#'use_config_qty_increments', 'qty_increments',#'use_config_enable_qty_inc', 'enable_qty_increments',#'is_decimal_divided', '_media_is_disabled',#'tax_class_id']]
In [ ]:
magento_2_upload_file_with_data_no_desc
In [ ]:
#df_new_template['categories']
In [96]:
# set some more default values for magento 2
In [97]:
magento_2_upload_file_with_data_no_desc['attribute_set_code'] = 'Default'#magento_2_upload_file_with_data_no_desc['categories'] =#magento_2_upload_file_with_data_no_desc['height'] =#magento_2_upload_file_with_data_no_desc['length'] =magento_2_upload_file_with_data_no_desc['product_online'] = 1magento_2_upload_file_with_data_no_desc['product_type'] = 'simple'magento_2_upload_file_with_data_no_desc['product_websites'] = 'base'magento_2_upload_file_with_data_no_desc['root_category'] = 'All'magento_2_upload_file_with_data_no_desc['store_view_code'] = ''magento_2_upload_file_with_data_no_desc['tax_class_name'] = 'Taxable Goods'#magento_2_upload_file_with_data_no_desc['width'] =
take the default values set before in the section marked as
Check couple of steps up “
#set some default values that you want to upload to Magento 2
#default values are in list format so that it can be aligned with other data “
In [99]:
magento_2_upload_file_with_data_no_desc#magento_2_upload_file_with_data_no_desc['_type'] = typemagento_2_upload_file_with_data_no_desc['_attribute_set'] = _attribute_setmagento_2_upload_file_with_data_no_desc['qty'] = qtymagento_2_upload_file_with_data_no_desc['min_qty'] = min_qtymagento_2_upload_file_with_data_no_desc['use_config_min_qty'] = use_config_min_qtymagento_2_upload_file_with_data_no_desc['is_qty_decimal'] = is_qty_decimalmagento_2_upload_file_with_data_no_desc['backorders'] = backordersmagento_2_upload_file_with_data_no_desc['use_config_backorders'] = use_config_backordersmagento_2_upload_file_with_data_no_desc['min_sale_qty'] = min_sale_qtymagento_2_upload_file_with_data_no_desc['use_config_min_sale_qty'] = use_config_min_sale_qtymagento_2_upload_file_with_data_no_desc['max_sale_qty'] = max_sale_qtymagento_2_upload_file_with_data_no_desc['use_config_max_sale_qty'] = use_config_max_sale_qtymagento_2_upload_file_with_data_no_desc['notify_stock_qty'] = notify_stock_qtymagento_2_upload_file_with_data_no_desc['use_config_notify_stock_qty'] = use_config_notify_stock_qtymagento_2_upload_file_with_data_no_desc['manage_stock'] = manage_stockmagento_2_upload_file_with_data_no_desc['use_config_manage_stock'] = use_config_manage_stockmagento_2_upload_file_with_data_no_desc['stock_status_changed_auto'] = stock_status_changed_automagento_2_upload_file_with_data_no_desc['use_config_qty_increments'] = use_config_qty_incrementsmagento_2_upload_file_with_data_no_desc['qty_increments'] = qty_incrementsmagento_2_upload_file_with_data_no_desc['use_config_enable_qty_inc'] = use_config_enable_qty_incmagento_2_upload_file_with_data_no_desc['enable_qty_increments'] = enable_qty_incrementsmagento_2_upload_file_with_data_no_desc['is_decimal_divided'] = is_decimal_dividedmagento_2_upload_file_with_data_no_desc['_media_is_disabled'] = _media_is_disabledmagento_2_upload_file_with_data_no_desc['tax_class_id'] = tax_class_id
In [100]:
#magento_2_upload_file_with_data_no_desc['categories'] = magento_1_upload_file_with_data_no_desc['_category']
In [101]:
magento_2_upload_file_with_data_no_desc['visibility'] = BC2
In [102]:
#magento_1_upload_file_with_data_no_desc.drop( columns = "", axis=1)magento_2_upload_file_with_data_no_desc.columns
Out[102]:
Index(['product_id', 'sku', 'name', 'raw_price', 'cheapest_courier_shipping',
'product_ean', 'shopforsoul_profit', 'ebay_profit', 'shopforsoul_cost',
'price', 'special_price', 'special_from_date', 'special_to_date',
'ebay_cost', 'ebay_list_price', 'amazon_profit', 'amazon_our_cost',
'amazon_list_price', 'amazon_special_price', 'amazon_list_price_usd',
'amazon_special_price_usd', 'amazon_list_price_gbp',
'amazon_special_price_gbp', 'amazon_list_price_eu',
'amazon_special_price_eu', 'weight', 'is_in_stock', 'categories',
'visibility', 'height', 'width', 'length', 'status',
'attribute_set_code', 'product_online', 'product_type',
'product_websites', 'root_category', 'store_view_code',
'tax_class_name', '_attribute_set', 'qty', 'min_qty',
'use_config_min_qty', 'is_qty_decimal', 'backorders',
'use_config_backorders', 'min_sale_qty', 'use_config_min_sale_qty',
'max_sale_qty', 'use_config_max_sale_qty', 'notify_stock_qty',
'use_config_notify_stock_qty', 'manage_stock',
'use_config_manage_stock', 'stock_status_changed_auto',
'use_config_qty_increments', 'qty_increments',
'use_config_enable_qty_inc', 'enable_qty_increments',
'is_decimal_divided', '_media_is_disabled', 'tax_class_id'],
dtype='object')
In [103]:
# drop products with the same sku
In [104]:
#magento_1_upload_file_with_data_no_desc.drop(['categories'], inplace=True, axis=1)# sorting by first name#magento_1_upload_file_with_data_no_desc.sort_values("sku", inplace = True)# dropping ALL duplicte valuesmagento_2_upload_file_with_data_no_desc.drop_duplicates(subset ="sku", keep = False, inplace = True)
In [ ]:
# save the output file i.e. to load to magento 2
# no image data/url as part of the upload file
In [105]:
#output_folder = './data-supplier-20219-04-14/output/';magento_2_upload_file_with_data_no_desc.to_csv( output_folder + 'no-image-all_to_upload_without_description_' + input_file_name + '_magento_2_' + today + '.csv',index=False, encoding='utf8')
In [ ]:
# divide the output into multiple files
All code in one block. Still indenting might be required
# In[86]:# calculate/adjust data so that we can create magento 2 upload files
# csv file to upload to Magento 2# In[88]:# load the template : i.e. columns required for magento 2 upload
magento_2_upload_template_file = template_folder + ‘magento2_catalog_product.csv’ #’all-to-upload-without-description.csv’
magento_2_upload_template_file = pd.read_csv(magento_2_upload_template_file)# In[89]:magento_2_upload_template_file.columns# In[90]:price_calculation_df.columns# In[91]:price_calculation_df.rename(columns={‘Height mm’: ‘height’}, inplace=True)
price_calculation_df.rename(columns={‘Depth mm’: ‘length’, ‘Width mm’: ‘width’}, inplace=True)
price_calculation_df.rename(columns={‘Special List Price’:’special_price’, ‘MLP’:’price’, ‘Stock status’:’is_in_stock’}, inplace=True)
#amazon_our_cost_usd
price_calculation_df.rename(columns={‘Name’:’name’, ‘Weight’:’weight’}, inplace=True) #, ‘use_config_min_qty’, ‘visibility’# In[92]:# set some default values that you want to upload to Magento 2
# default values are in list format so that it can be aligned with other data# In[93]:type = [‘simple’] * price_calculation_df.shape[0]
_attribute_set = [‘Default’] * price_calculation_df.shape[0]
qty = [10] * price_calculation_df.shape[0]
min_qty = [1] * price_calculation_df.shape[0]
use_config_min_qty = [1] * price_calculation_df.shape[0]
is_qty_decimal = [0] * price_calculation_df.shape[0]
backorders = [0] * price_calculation_df.shape[0]
use_config_backorders = [1] * price_calculation_df.shape[0]
min_sale_qty = [1] * price_calculation_df.shape[0]
use_config_min_sale_qty = [1] * price_calculation_df.shape[0]
max_sale_qty = [2] * price_calculation_df.shape[0]
use_config_max_sale_qty = [1] * price_calculation_df.shape[0]
notify_stock_qty = [0] * price_calculation_df.shape[0]
use_config_notify_stock_qty = [1] * price_calculation_df.shape[0]
manage_stock = [0] * price_calculation_df.shape[0]
use_config_manage_stock = [1] * price_calculation_df.shape[0]
stock_status_changed_auto = [0] * price_calculation_df.shape[0]
use_config_qty_increments = [1] * price_calculation_df.shape[0]
qty_increments = [0] * price_calculation_df.shape[0]
use_config_enable_qty_inc = [1] * price_calculation_df.shape[0]
enable_qty_increments = [0] * price_calculation_df.shape[0]
is_decimal_divided = [0] * price_calculation_df.shape[0]
_media_is_disabled = [0] * price_calculation_df.shape[0]
tax_class_id = [2] * price_calculation_df.shape[0]# In[94]:# creatinf dataframe to store data to upload to Magento 2
# this dataframe will be saved to a csv file# In[95]:magento_2_upload_file_with_data_no_desc = price_calculation_df[[
‘sku’,
#’store_view_code’,
#’attribute_set_code’,
#’product_type’,
#’categories’,
#’product_websites’, ‘name’,
#’description’,
#’short_description’,
‘weight’,
#’product_online’,
#’tax_class_name’,
#’visibility’,
‘price’,
‘special_price’,
#’special_price_from_date’,
#’special_price_to_date’,
#’url_key’,
#’meta_title’,
#’meta_keywords’,
#’meta_description’,
#’created_at’,
#’updated_at’,
#’new_from_date’,
#’new_to_date’,
#’display_product_options_in’,
#’map_price’, ‘msrp_price’,
#’map_enabled’,
#’gift_message_available’,
#’custom_design’,
#’custom_design_from’,
#’custom_design_to’,
#’custom_layout_update’,
#’page_layout’,
#’product_options_container’,
#’msrp_display_actual_price_type’,
#’country_of_manufacture’,
#’additional_attributes’,
#’qty’,
#’out_of_stock_qty’,
#’use_config_min_qty’,
#’is_qty_decimal’,
#’allow_backorders’,
#’use_config_backorders’,
#’min_cart_qty’,
#’use_config_min_sale_qty’,
#’max_cart_qty’,
#’use_config_max_sale_qty’,
‘is_in_stock’,
#’notify_on_stock_below’,
#’use_config_notify_stock_qty’,
#’manage_stock’,
#’use_config_manage_stock’,
#’use_config_qty_increments’,
#’qty_increments’,
#’use_config_enable_qty_inc’,
#’enable_qty_increments’,
#’is_decimal_divided’,
#’website_id’,
#’deferred_stock_update’,
#’use_config_deferred_stock_update’,
#’related_skus’,
#’crosssell_skus’,
#’upsell_skus’,
#’hide_from_product_page’,
#’custom_options’,
#’bundle_price_type’, ‘bundle_sku_type’, ‘bundle_price_view’,
#’bundle_weight_type’, ‘bundle_values’, ‘associated_skus’
]]magento_2_upload_file_with_data_no_desc = price_calculation_df[[‘product_id’, ‘sku’, ‘name’, ‘raw_price’,
#’dummy’,
‘cheapest_courier_shipping’, ‘product_ean’, ‘shopforsoul_profit’,
‘ebay_profit’, ‘shopforsoul_cost’, ‘price’, ‘special_price’,
‘special_from_date’, ‘special_to_date’, ‘ebay_cost’, ‘ebay_list_price’,
‘amazon_profit’,
‘amazon_our_cost’, ‘amazon_list_price’,
‘amazon_special_price’, ‘amazon_list_price_usd’,
‘amazon_special_price_usd’, ‘amazon_list_price_gbp’,
‘amazon_special_price_gbp’, ‘amazon_list_price_eu’,
‘amazon_special_price_eu’, ‘weight’, ‘is_in_stock’, ‘categories’,
#’_root_category’,
‘visibility’,
‘height’, ‘width’,
‘length’,
‘status’,
#’_type’, ‘_attribute_set’, ‘qty’, ‘min_qty’,
#’use_config_min_qty’,
#’is_qty_decimal’, ‘backorders’,
#’use_config_backorders’, ‘min_sale_qty’, ‘use_config_min_sale_qty’,
#’max_sale_qty’, ‘use_config_max_sale_qty’, ‘notify_stock_qty’,
#’use_config_notify_stock_qty’, ‘manage_stock’,
#’use_config_manage_stock’, ‘stock_status_changed_auto’,
#’use_config_qty_increments’, ‘qty_increments’,
#’use_config_enable_qty_inc’, ‘enable_qty_increments’,
#’is_decimal_divided’, ‘_media_is_disabled’,
#’tax_class_id’
]]# In[ ]:magento_2_upload_file_with_data_no_desc# In[ ]:#df_new_template[‘categories’]# In[96]:# set some more default values for magento 2# In[97]:magento_2_upload_file_with_data_no_desc[‘attribute_set_code’] = ‘Default’
#magento_2_upload_file_with_data_no_desc[‘categories’] =
#magento_2_upload_file_with_data_no_desc[‘height’] =
#magento_2_upload_file_with_data_no_desc[‘length’] =
magento_2_upload_file_with_data_no_desc[‘product_online’] = 1
magento_2_upload_file_with_data_no_desc[‘product_type’] = ‘simple’
magento_2_upload_file_with_data_no_desc[‘product_websites’] = ‘base’
magento_2_upload_file_with_data_no_desc[‘root_category’] = ‘All’
magento_2_upload_file_with_data_no_desc[‘store_view_code’] = ‘’
magento_2_upload_file_with_data_no_desc[‘tax_class_name’] = ‘Taxable Goods’
#magento_2_upload_file_with_data_no_desc[‘width’] =# # take the default values set before in the section marked as
# Check couple of steps up
# “
# #set some default values that you want to upload to Magento 2
# #default values are in list format so that it can be aligned with other data
# “# In[99]:magento_2_upload_file_with_data_no_desc
#magento_2_upload_file_with_data_no_desc[‘_type’] = type
magento_2_upload_file_with_data_no_desc[‘_attribute_set’] = _attribute_set
magento_2_upload_file_with_data_no_desc[‘qty’] = qty
magento_2_upload_file_with_data_no_desc[‘min_qty’] = min_qty
magento_2_upload_file_with_data_no_desc[‘use_config_min_qty’] = use_config_min_qty
magento_2_upload_file_with_data_no_desc[‘is_qty_decimal’] = is_qty_decimal
magento_2_upload_file_with_data_no_desc[‘backorders’] = backorders
magento_2_upload_file_with_data_no_desc[‘use_config_backorders’] = use_config_backorders
magento_2_upload_file_with_data_no_desc[‘min_sale_qty’] = min_sale_qty
magento_2_upload_file_with_data_no_desc[‘use_config_min_sale_qty’] = use_config_min_sale_qty
magento_2_upload_file_with_data_no_desc[‘max_sale_qty’] = max_sale_qty
magento_2_upload_file_with_data_no_desc[‘use_config_max_sale_qty’] = use_config_max_sale_qty
magento_2_upload_file_with_data_no_desc[‘notify_stock_qty’] = notify_stock_qty
magento_2_upload_file_with_data_no_desc[‘use_config_notify_stock_qty’] = use_config_notify_stock_qty
magento_2_upload_file_with_data_no_desc[‘manage_stock’] = manage_stock
magento_2_upload_file_with_data_no_desc[‘use_config_manage_stock’] = use_config_manage_stock
magento_2_upload_file_with_data_no_desc[‘stock_status_changed_auto’] = stock_status_changed_auto
magento_2_upload_file_with_data_no_desc[‘use_config_qty_increments’] = use_config_qty_increments
magento_2_upload_file_with_data_no_desc[‘qty_increments’] = qty_increments
magento_2_upload_file_with_data_no_desc[‘use_config_enable_qty_inc’] = use_config_enable_qty_inc
magento_2_upload_file_with_data_no_desc[‘enable_qty_increments’] = enable_qty_increments
magento_2_upload_file_with_data_no_desc[‘is_decimal_divided’] = is_decimal_divided
magento_2_upload_file_with_data_no_desc[‘_media_is_disabled’] = _media_is_disabled
magento_2_upload_file_with_data_no_desc[‘tax_class_id’] = tax_class_id# In[100]:#magento_2_upload_file_with_data_no_desc[‘categories’] = magento_1_upload_file_with_data_no_desc[‘_category’]# In[101]:magento_2_upload_file_with_data_no_desc[‘visibility’] = BC2# In[102]:#magento_1_upload_file_with_data_no_desc.drop( columns = “”, axis=1)
magento_2_upload_file_with_data_no_desc.columns# In[103]:# drop products with the same sku# In[104]:#magento_1_upload_file_with_data_no_desc.drop([‘categories’], inplace=True, axis=1)
# sorting by first name
#magento_1_upload_file_with_data_no_desc.sort_values(“sku”, inplace = True)
# dropping ALL duplicte values
magento_2_upload_file_with_data_no_desc.drop_duplicates(subset =”sku”,
keep = False, inplace = True)# In[ ]:# save the output file i.e. to load to magento 2
# no image data/url as part of the upload file# In[105]:#output_folder = ‘data-china-2020–03–29/’
#output_folder = ‘./data-supplier-2020–04–14/output/’;
magento_2_upload_file_with_data_no_desc.to_csv( output_folder + ‘no-image-all_to_upload_without_description_’ + input_file_name + ‘_magento_2_’ + today + ‘.csv’,index=False, encoding=’utf8')# In[ ]:# divide the output into multiple files
Medium: https://medium.com/@SayedAhmedCanada
*** . *** *** . *** . *** . ***
Sayed Ahmed
BSc. Eng. in Comp. Sc. & Eng. (BUET)
MSc. in Comp. Sc. (U of Manitoba, Canada)
MSc. in Data Science and Analytics (Ryerson University, Canada)
Linkedin: https://ca.linkedin.com/in/sayedjustetc
Blog: http://Bangla.SaLearningSchool.com, http://SitesTree.com
Training Courses: http://Training.SitesTree.com
8112223 Canada Inc/Justetc: http://JustEtc.net
Facebook Groups/Forums to discuss (Q & A):
https://www.facebook.com/banglasalearningschool
https://www.facebook.com/justetcsocial
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. http://sitestree.com/training/