N.A.
N.A.

Reputation: 103

Generating points and discarding the first few points with Python

I have defined an array that contains 1000 points, to illustrate, something like this:

x = np.zeros([1000, 2])
for i in range(1001):
   x =  'int + [i , i] / 2'

How do I plot the points with plt.scatter()? I have tried with just inserting x, but it doent work. Thank you in advance!

Upvotes: 0

Views: 50

Answers (1)

T C Molenaar
T C Molenaar

Reputation: 3260

I think you're trying to do something like this:

import matplotlib.pyplot as plt

x = np.zeros([1000, 2])
for i in range(len(x)):
   x[i] =  [i/2 , i/2]

plt.scatter(x[:,0],x[:,1])
plt.show()

If anything isn't clear, don't hesitate to ask!

Upvotes: 1

Related Questions