Nov-04-2022, 04:36 AM
OK, so on further reading I've found this post.
how often does a word occur in this column?
https://python-forum.io/thread-10857.htm...ght=genres
If I copy & paste my data into python as per the example it works, but when I try & read it from the CSV file it does not work.
I'd assume it has something to do with multiple rows or not adding a comma after each row..
how often does a word occur in this column?
https://python-forum.io/thread-10857.htm...ght=genres
If I copy & paste my data into python as per the example it works, but when I try & read it from the CSV file it does not work.
import pandas as pd import os party = pd.read_csv('party.csv') data = party['ATTENDEES'] data_list = data.replace('\n', ',') data_list = data_list.strip().split(',') print(Counter(data_list).most_common(15))Could someone please explain why when I use this it works
data = 'John,Jan,Paul,Kylie,Paul,Scott,Jason,Jan,Scott,John'BUT
party = pd.read_csv('party.csv') data = party['ATTENDEES']Does not work
I'd assume it has something to do with multiple rows or not adding a comma after each row..