Category : arraylist

swepttour = [(39.57, 26.15), (36.26, 23.12), (40.56, 25.32), (37.52, 20.44), (38.24, 20.42), (39.36, 19.56), (37.51, 15.17), (35.49, 14.32), (38.15, 15.35), (38.47, 15.13), (38.42, 13.11), (37.56, 12.19), (41.17, 13.05), (33.48, 10.54), (41.23, 9.1), (36.08, -5.21), (39.57, 26.15)] I have such a list and I want to change the position of the second element(element at index 1) ..

Read more

Im using the Sklearn to build a random forest model; I’ve got a slight problem where i’ve trained the model and set prediction of both however I’ve somehow lost a value; Using: from sklearn.metrics import accuracy_score print(‘Accuracy:’, accuracy_score(y_pre_crime[1:],y_pre_crime_score)) I’m getting the error: Found input variables with inconsistent numbers of samples: [73495, 73496] Anyone else has ..

Read more

Soo, i’m trying to create a list of lists in python. Here is the code: class CacheL1: def __init__(self): self.vias = [] for via in range(2): self.conjuntos = [] for conj in range(4): self.conjunto = Via(0, 0, 0) self.conjuntos.append(self.conjunto) self.vias.append(self.conjuntos[:]) All positions should have different objects, but I am storing the same lists in different ..

Read more

Blockquote For instance (making this slightly simpler to explain by not outlining this as the list of 3×3 arrays I actually need to be subtracting by. x=[0,1,2,3,4,5]—- that’s the starting matrix 0-1=-1; -1-2=-3; -3-3=-6; -6-4=-10; -10-5=-15 In this case I would want a matrix that basically shows [-1,-3,-6,-10,-15] I need a for loop that will ..

Read more