I have below data frame and my label column as u can see is part of sentence row and its separated by \ character. My question is how can I delete these zero and ones or replace them with " " character and transition them to new Label column beside this comment column?
thanks for you're help.
CodePudding user response:
You are loading your dataset wrong.
It is a tab-separated file. You are loading it as a comma-separated file.
Try adding \t
as a separator while loading the file. This will create two columns. Also, you can add column names while loading.
Example:
pandas.read_csv(filename, sep='\t', names=['tag', 'text'])