Discussion:
[pytables-users] Website tutorial error
Christopher Turnbull
2016-03-14 09:39:56 UTC
Permalink
<div id="inner-editor"><br class="Apple-interchange-newline">gcolumns =
h5file.create_group(h5file.root, "columns", "Pressure and Name")
h5file.create_array(gcolumns, 'pressure', array(pressure), "Pressure column
selection")</div>

gcolumns = h5file.create_group(h5file.root, "columns", "Pressure and Name")

h5file.create_array(gcolumns, 'pressure', array(pressure),

"Pressure column selection")

---------------------------------------------------------------------------NameError Traceback (most recent call last)<ipython-input-2-aec3a6161035> in <module>() 1 gcolumns = h5file.create_group(h5file.root, "columns", "Pressure and Name")----> 2 h5file.create_array(gcolumns, 'pressure', array(pressure), 3 "Pressure column selection")
NameError: name 'array' is not defined
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Christopher Turnbull
2016-03-14 09:40:56 UTC
Permalink
Hey guys. This is the tutorial of pytables website; it's one of the first
steps, why wouldn't this be working out?
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Francesc Alted
2016-03-14 12:43:56 UTC
Permalink
Which tutorial exactly? This seems like a newline has been introduced
inadvertently.
Post by Christopher Turnbull
Hey guys. This is the tutorial of pytables website; it's one of the first
steps, why wouldn't this be working out?
--
You received this message because you are subscribed to the Google Groups
"pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Francesc Alted
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Christopher Turnbull
2016-03-14 15:38:08 UTC
Permalink
The only one on the website- just a little way in under the 'Creating
Arrays' section:

http://www.pytables.org/usersguide/tutorials.html
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Francesc Alted
2016-03-14 15:46:31 UTC
Permalink
Fixed in
https://github.com/PyTables/PyTables/commit/d5cebddfc8a0470090cd0231332893a4b863af79
.

Francesc
Post by Christopher Turnbull
The only one on the website- just a little way in under the 'Creating
http://www.pytables.org/usersguide/tutorials.html
--
Francesc Alted
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Christopher Turnbull
2016-03-14 16:07:12 UTC
Permalink
Same issue still- I'm not sure it is, or maybe it's just an error on my
part, but for some reason it's not recognising array(pressure)
Hmm.

NameError Traceback (most recent call last)<ipython-input-6-7270eb3bd044> in <module>() 3 4 ----> 5 h5file.create_array(gcolumns, 'pressure', array(pressure), "Pressure column selection")
NameError: name 'array' is not defined
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
David Dotson
2016-03-14 17:46:56 UTC
Permalink
A `NameError` indicates that you are using a name that isn't in the namespace. The context of this statement in the tutorial is that this is creating a numpy array from whatever `pressure` is (probably a list). So you could do

```python

from numpy import array

```

to add numpy's `array` function for building numpy arrays from iterables.

David
Same issue still- I'm not sure it is, or maybe it's just an error on my part, but for some reason it's not recognising array(pressure)
Hmm.
NameError Traceback (most recent call last)
<ipython-input-6-7270eb3bd044> in <module>() 3 4 ----> 5h5file.create_array(gcolumns, 'pressure', array(pressure), "Pressure column selection")NameError: name 'array' is not defined
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Christopher Turnbull
2016-03-15 10:48:01 UTC
Permalink
Yep, thanks that seemed to resolve it.

So in the tutorial I guess we were supposed to do:

from numpy import *
--
You received this message because you are subscribed to the Google Groups "pytables-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytables-users+***@googlegroups.com.
To post to this group, send an email to pytables-***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...