This message was deleted.
# help
s
This message was deleted.
m
I think this renaming column method might work for my option a) above (just saw this Data wrangling essentials notebook posted in #community)! Still curious about option b) above.
a
Here’s a bit more information on bracket notation
d["name"]
to access properties (works for property names with spaces, hyphens, start with numbers, etc - things that break with the
d.name
dot notation): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#accessing_properties
m
To add to what Allison said, you need
d["weight (lb)"]
instead of
d.weight (lb)
. In JavaScript,
d.foo
is shorthand for
d["foo"]
. But you can only use that shorthand when
foo
is a valid JavaScript identifier.
weight (lb)
is not a valid JavaScript identifier because it has a space and parens, so you have to use the long form.
👍 3
m
Thanks so much @Allison (Observable Team) and @Mike Bostock! I appreciate how your bit of time given to this was way more helpful than the hour or more I spent fumbling with Google searches.