Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Counting in a csv file
#5
Yes I guess I really don't what I am doing here. My csv file has a column, "Facility Name" for which I want to count words. This code gets me the name of the column, not the data:

import pandas as pd
from collections import Counter

myVar=pd.read_csv(r'C:\Users\Owner\Documents\UberUpdate\Hospital_General_Information.csv',
sep = ",",
usecols = [1])
MyCounter=Counter()
MyCounter.update(myVar)
print(MyCounter)

Result is -
Counter({'Facility Name': 1})
Reply


Messages In This Thread
Counting in a csv file - by standenman - Aug-24-2020, 02:57 PM
RE: Counting in a csv file - by Larz60+ - Aug-24-2020, 04:52 PM
RE: Counting in a csv file - by standenman - Aug-24-2020, 10:03 PM
RE: Counting in a csv file - by micseydel - Aug-24-2020, 10:12 PM
RE: Counting in a csv file - by standenman - Aug-24-2020, 10:38 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020