I have a Excel sheet which I read using pd.read_excel() method. When I am trying to add new columns using my_frame['Test'] = my_frame['My Column'] it throws an error
Tried reading excel file in utf-8 format by using pd.read_excel('encoding'='utf-8') but it did not work. The preprocess_price_file(temp_df) function produces a sliced dataframe and performs some pre-processing which includes dropping some NA rows.
prod_dfs = []
product_price_files = glob.glob('files/product_price/*.xlsx')
for c_file in product_price_files:
temp_df = pd.read_excel(c_file,encoding = "utf-8")
temp_df = self.preprocess_price_file(temp_df)
prod_dfs.append(temp_df)
prods_df = pd.concat(prod_dfs)
prods_df['Test'] = prods_df['My Column']
return prods_df
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf8 in position 6: ordinal not in range(128)