preprocessed-connectomes-project / quality-assessment-protocol

Scripts and documentation for the PCP's protocol for assessing data quality.
BSD 3-Clause "New" or "Revised" License
40 stars 23 forks source link

ValueError: x and y must have same first dimension, but have shapes (1,) and (10,) #124

Open atdortch opened 6 years ago

atdortch commented 6 years ago

I am trying to fix this answer. please help. I think it has something to do with my arrays.

import numpy as np import random as rand import matplotlib.pyplot as plt

particles = 10 steps = 20

position = np.zeros(particles) # position of particles start at zero

right = 1; left = 2 # assign values to left and right positions

for step in range(steps):
for p in range(particles): walk = rand.randint(1,2) if walk == right: position[p] += 1 elif walk == left: position[p] -=1 displacement = position-0

print(position)

plt.plot(steps,displacement)