How many items are values in dictionaries, Python [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm looking to find out how to write the code to see how many values a key has in a dictionary.
For example, I'm doing a small survey on a class to see the colour of eyes, I make a dictionary and put all of their names into the dictionary as strings as values. How do i find out how many people have each colour eyes?

survey = {'blue' : ['Kyle', 'Josh', 'Michael']}
len(survey['blue'])

Related

Remove particular character from a string python? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have to remove this: ® Character from a string in Python.
Whole string is:
'Rainbow® Super Value Construction Paper, 12" x 18", Assorted Colors, Pack Of 100'
There is a translate method to deal with unwanted characters, but probably
string.replace('®', '')
is easier to write.

save scale data and recall data back into scale [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need to create a code that will take 24 scale values and save them in a txt. file, i then want to be able to recall these values and put them back into the 24 scales. can someone point me in the right direction.
Thanks
First read this :
http://docs.python.org/2/library/stdtypes.html#bltin-file-objects
then write some code and come back with concrete questions if necessary.

lil-Sparse matrix row splitting [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a large sparse matrix (lil) implemented in Python with scipy, which comprises of Users on one axis, and songs they played on the other. So each row is a linked list of the songs that user has played.
I need to split each row ( user's songs ) so i have training and test data, but I'm unsure of how to do this. Sorry, im new to python, any help would be greatly appreciated.
I think you need sklearn.cross_validation.train_test_split

Is Python has any english dictionary that returns a list of words with the same meaning? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
For example, input USA, output America. Is that such module? I use it for Natural Language Processing.
Get NLTK module: http://nltk.org/install.html
import corpus:http://nltk.org/data.html
Play arround:
>>> from nltk.corpus import wordnet as wn
>>> wn.synsets('USA')

How to determine parallactic angle using pyephem [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can I determine the parallactic angle of a target in pyEphem given a fixed object and an observer?
I am trying to use pyEphem to create an instrument simulator and I need to determine the rate at which the instrument rotator will be turning to de-rotate the field (this is an alt-az telescope), so really I'm trying to determine the rate of change of the parallactic angle.
thanks,
Josh

Categories

Resources