You are a guest. Restricted access. Read more

<< back

1D arrays

1D arrays in SCaVis are designed for numerical calculations and are optimized for numbers. We first consider P0D arrays (to hold double values) and P0I (to hold integer values)


from jhplot import P0D
p0=P0D("test")
for i in range(10):
      p0.add(i)
print p0.toString()

One can view the data containers using several methods. One is toString() which converts data into a string. One can write data into a file (including a compression) using the method toFile(file). One can also view data in a sortable table using the method toTable():


from jhplot  import P0D
p0=P0D("test")
for i in range(1,50,2):
      p0.add(i)
p0.toTable()

As for any SCaVis data object, one can write and read arrays into files using the method “toFile” and read using the method “read()”

p0.toFile("data.txt")

and read it back as:

p0.read("data.txt")

If a file was zipped use the method “readZip()”.

One can access various statistical characteristics of the P0D arrays as:


from jhplot  import P0D
p0=P0D("test")
for i in range(1,50,2):
      p0.add(i)
print p0.getStatString()

Exercise: try to increase the number of iteration to 1000 and see the output.

You have a limited access to this reference manual. One can unlock it after becoming a full member.

scavis/collections/1d_arrays.txt · Last modified: 2013/04/14 16:52 (external edit)
Back to top
CC Attribution-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0