Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have 60 records with a column "skillsList" "("skillsList" is a list of skills) and "IdNo". I want to find out how many "IdNo's" have a skill in common.

How can I do it in python. I am not knowing how to take the count of a particular list item. Would appreciate any help.

>>> a = open("C:UsersabcDesktopBook2.csv")
>>> type(a1)
<type 'str'>

Some of the text when I print a1

>>> a1
'IdNo, skillsList
1,"u'Training', u'E-Learning', u'PowerPoint', u'Teaching', u'Accounting', u'Team Management', u'Team Building', u'Microsoft Excel', u'Microsoft Office', u'Financial Accounting', u'Microsoft Word', u'Customer Service'"
2,"u'Telecommunications', u'Data Center', u'ISO 27001', u'Management', u'BS25999', u'Technology', u'Information Technology...', u'Certified PMP\xae', u'Certified BS25999 Lead...'"
3,"u'Market Research', u'Segmentation', u'Marketing Strategy', u'Consumer Behavior', u'Experience Working with...'"

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
180 views
Welcome To Ask or Share your Answers For Others

1 Answer

You have to do it by yourself. you may use a dictionnary of skills , each item of the dic beeing inited to zero. Then iterate over your records and increment skill item when seen.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...