Home > front end >  To remove quotes in a dataframe column of strings
To remove quotes in a dataframe column of strings

Time:03-01

need assistance with something i think i pretty minor but cant seem to find a way around.

twitter_df['Split Tweets'] = twitter_df['Tweets'].apply(lambda x:(x.split())).astype(str).str.lower()

the above returns the desired result but i cant find a way around getting the quotation marks '.

Output

I need just the commas (,) to separate the string NOT quotation marks(')

thanks

CodePudding user response:

You need to specify the separator, if you are separating by comma then you need to specify

twitter_df['Split Tweets'] = twitter_df['Tweets'].apply(lambda x:(x.split(','))).astype(str).str.lower()

CodePudding user response:

I think the quotation marks show that these are lists of strings. If you do anything with the elements of these lists (such as print or concatenate), the quotation marks will not be shown.

  • Related