The PND class is rather similar to the P0D, but now data are stored in a multidimensional array. This class does not have also any graphical attributes, since it was mainly designed for data manipulations. To plot data as a histogram, one should convert a raw or column to a P0D object.
To construct a P0D and add some values, use:
>>> from jhplot import P0D >>> >>> p0=PND("example",dimension) # build a PND object >>> p0.add([1,2,3]) # append some values >>> p0.add([2,3,4]) >>> p0.add(P0D p0d) # append P0D object >>> p0.set(i,[1,2,3]) # set (replace) at position i >>> p0.set(i,P0D p0d) # set (replace) P0D object at position i >>> # here are fast methods to fill P0D: >>> array=p0.getArray(index) # get array[] at raw index >>> p0.setArray(array[][]) # fill with numbers from an array >>> p0.clear() # clear >>> p0.size() # get size (number of rows) >>> p0.getDimension() # get dimension >>> m=get(row,column) # get a value at row and column >>> p0=PND("example",dimension,file) # build a PND object from a file
As before, avoid operations with primitive types like add() or set() to make a program faster. All other classes are rather similar to the P0D. For example, to write data to a file, use:
>>> p0.toFile("file name") # output to a file
One can easily get an array from a certain column or a row in form of P0D using the following methods:
>>> p0.getRaw(index) # get a row at index as P0D >>> p0.getColumn(index) # get a column at index as P0D
Once P0D is obtained, one can make a histogram using P0D method getH1D(). Look at the API to learn more about the PND methods.