python - Text File to Numpy Array -


good evening, have text file has letters, floats , ints such this:

p 0 0
p 1 0
p .5 1
p .1 2
f 3 1 2
f 2 1 4
f 4 1 3
w -20.0 -20.0 20 20

so basically:
p = points(x,y)
f = faces f 4 1 3 means connect p4 p1 , p3 creating lines between these points create figure
w = window size on canvas through tkinter

i'm attempting read in text file array through numpy using:

np.genfromtxt(filename, delimiter=' ', dtype=none) 

but keep getting valueerror: got 3 columns instead of 2

at point, there way store of data array ? or should store them separate lists p, f, , w , converting lists parray, farray, , warray ? , connecting points drawing lines using these different arrays ?


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -