Message Boards Message Boards

0
|
8234 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Return a list with at least 2 entities with ElementData?

Posted 9 years ago

Hello

Using the same code structure as

PlanetData[ EntityClass["Planet", "OuterPlanet"], {"Name", "MoonCount"}]`

which works quite well (a list with the values of 2 properties is returned), I would like to make it work with

ElementData[EntityClass["Element", "Radioactive"], {"Name", "HalfLife"}]'

I get an error message although these properties are known.

To bypass it I have to use a much longer code:

l1 = ElementData[EntityClass["Element", "Radioactive"], "Name"];
l2 = ElementData[EntityClass["Element", "Radioactive"], "HalfLife"];
Thread[Join[{l1, l2}]]

Why the much shorter code above does not work?

Thanks

POSTED BY: wojtek potocki
2 Replies
Posted 9 years ago

Thanks. It would be nice in future releases to query data from all the functions like ElementData with the same structure of code.

POSTED BY: Jan Potocki

Thank you for letting us know about this.

Some functions have undocumented features. In this case, it looks to me like Planet data has an undocumented feature that allows it to take multiple queries. I've forwarded a note to the developers about this, so they can consider supporting this kind of query across another functions like ElementData.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract