Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Loop does not work in python
Post: RE: Loop does not work in python

Still the same problem....
Ola92 Homework 11 4,830 Jan-13-2020, 06:27 PM
    Thread: Loop does not work in python
Post: RE: Loop does not work in python

I ran it again and for import numpy as np print(clusterAnalysis(np.array([1.7, 1.6, 1.3, 1.3, 2.8, 1.4, 2.8, 2.6, 1.6, 2.7, 1.1])))The output of the code is [2 2 2 2 1 2 1 1 2 1 2]but it should be [1...
Ola92 Homework 11 4,830 Jan-13-2020, 12:20 PM
    Thread: Loop does not work in python
Post: RE: Loop does not work in python

Yes! it actually works for the print(clusterAnalysis(np.array([1.7, 1.6, 1.3, 1.3, 2.8, 1.4,2.8, 2.6, 1.6, 2.7])))However, if I put it into the checking software( the one that check the assigments) an...
Ola92 Homework 11 4,830 Jan-13-2020, 10:18 AM
    Thread: Loop does not work in python
Post: RE: Loop does not work in python

It seems that I misunderstood the step : Assignment step: Assign each measurement to the cluster with the closest mean value. In case of a tie,assign the measurement to cluster 1 in the assigment. I c...
Ola92 Homework 11 4,830 Jan-12-2020, 08:50 PM
    Thread: Loop does not work in python
Post: RE: Loop does not work in python

Can you give me any tip how to change it?
Ola92 Homework 11 4,830 Jan-12-2020, 07:42 PM
    Thread: Loop does not work in python
Post: RE: Loop does not work in python

Yes, sorry my mistake. import numpy as np import math def clusterAnalysis(reflectance): ref=np.size(reflectance) even1=np.any(ref %2==0) uneven1=np.any(ref%2>0) even2="2" uneve...
Ola92 Homework 11 4,830 Jan-12-2020, 06:22 PM
    Thread: Loop does not work in python
Post: Loop does not work in python

It seems that my loop function does not work and I do not understand why.. I get a result 2 and I should get this list of number:2 2 2 2 1 2 1 1 2 1. My code: import numpy as np import math def clus...
Ola92 Homework 11 4,830 Jan-12-2020, 10:12 AM
    Thread: Looping exercise Bacteria growth
Post: RE: Looping exercise Bacteria growth

Yes, I have noticed that mistake in my code. Thank you again for your help! I need help with one more exercise... It seems that my loop function does not work and I do not understand why.. I get a re...
Ola92 Homework 5 5,373 Jan-11-2020, 11:09 PM
    Thread: Looping exercise Bacteria growth
Post: RE: Looping exercise Bacteria growth

Thank you for your reply:) I have updated my code with your help and since its an assignment I have to submit, it has to have a return "tN" as an output of the function. I used what you told me and t...
Ola92 Homework 5 5,373 Jan-10-2020, 01:09 PM
    Thread: Looping exercise Bacteria growth
Post: Looping exercise Bacteria growth

Hi. I am taking a python course(I am a complete beginner) and I am unable to solve one of the assigned exercises. Can someone help me understand how can I input the "t" into the code to get tN as outp...
Ola92 Homework 5 5,373 Jan-10-2020, 11:28 AM

User Panel Messages

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