User Profile

Collapse

Profile Sidebar

Collapse
crumble113
crumble113
Last Activity: Oct 15 '12, 03:57 PM
Joined: Oct 14 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • crumble113
    replied to Problem with Numpy Standard Deviation
    Could you please tell me what's wrong with this following code?
    Code:
    def test_iterate(corpus_reader, sample_size, number_of_samples):
    for i in xrange(number_of_samples):
    tokens = corpus_reader.sample_words_by_sents(sample_size)
    sents = corpus_reader.sample_sents(sample_size)
    print expected_sentiment_tokens(tokens)
    s = ([expected_sentiment_tokens(tokens)])
    s.append(expected_sentiment_tokens(tokens))
    ...
    See more | Go to post
    Last edited by Rabbit; Oct 15 '12, 10:02 PM. Reason: Reverting post

    Leave a comment:


  • crumble113
    replied to Problem with Numpy Standard Deviation
    Thanks for the quick reply. I just tried that and this is what outputted
    Code:
    stats in for loop = 191.473684211
    stats in for loop = 186.277777778
    stats in for loop = 182.473684211
    stats in for loop = 182.611111111
    using stats = 182.611111111 <type 'float'>
    Average expected no of sentiment tokens: 182.611111111
    Do you know how I could fix my code to make it work correctly? Just need the averages and...
    See more | Go to post
    Last edited by Rabbit; Oct 15 '12, 10:02 PM. Reason: Reverting post

    Leave a comment:


  • crumble113
    started a topic Problem with Numpy Standard Deviation

    Problem with Numpy Standard Deviation

    Can anyone please tell me where I am going wrong with this for loop which is meant to take as input a specific corpus, sample size and number of samples and then give the averages of the expected sentiment tokens, normalised lexical diversity and probability of short sentences. It is also meant to give me the standard deviation of these three statistics too. I'm a real beginner with Python so not really sure where I've gone wrong Thanks a lot in...
    See more | Go to post
    Last edited by Rabbit; Oct 15 '12, 10:00 PM. Reason: Reverting post
No activity results to display
Show More
Working...