Closed pelas95 closed 4 years ago
Typo in the output generation. should be:
vs_results = [vs(row) for row in df['comment']] vs_df = pd.DataFrame(vs_results) text_df = pd.DataFrame(df, columns = ['channelId','comment']) final_df = text_df.join(vs_df)
final_df.to_csv('name.csv')
Hi,
Do you have any tips for applying the sentiment scores to an existing CSV? My data comprises of two columns, channelID and user comment. In the output, I can only get the first three rows with sentiment scores. My row of channel ID is also cleared.
I've tried reformatting my CSV using text-to-columns from fixed-with to delimited by tab but it did not help. Delimiting by commas is not possible, since the comment text contains columns.
I'm only a beginner and have been stuck with this issue for a while. Photos of my code and faulty output below:
Many thanks!
/P