I am creating an object in python. I have a numpy array from an H5 file that I would like to define within it. The numpy array is coordinates. I was poking around online and found tons of information about creating numpy arrays, or creating objects in numpy arrays.. but I can't find anything on defining an already made numpy array inside an object.
class Node(object):
def __init__(self, globalIndex, coordinates):
#Useful things to record
self.globalIndex = globalIndex
self.coordinates = numpy.coordinates
#Dictionaries to be used
self.localIndices ={}
self.GhostLayer = {}
My question: is there a specific way to define my numpy array within this class? If not (the fact that I couldn't find anything about it makes me think that it can't be done), how else could I import a numpy array?
numpy.coordinates? just usecoordinates.coordinatesis a numpy array, then that's what your new variable would be.