1

I've been trying to use Python and Pandas to take a csv as input, clean the dataset, and assign the output to a new csv file. One of the columns in the original csv has trademark symbols. When I export the new csv, the columns sometimes have ™ instead of just the trademark symbol, or sometimes they're turned into ™. This is how I imported the original csv and exported the new csv:

import pandas as pd df=pd.read_csv("original_df.csv", encoding='latin1',dtype='unicode') 

This is how I exported a new dataframe to csv:

df_new.to_csv('new_test_df.csv', index = False) 

How do I export the string without the extra symbols (i.e. how it was in the original)?

Thanks!

0

1 Answer 1

0

Just fixed this same problem. Answer and explanation can be found here

Quick answer is to use encoding "utf-8-sig"

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.