Make a table of dinosaurs, with pictures, sorted by weight.
Run the code to get the list of dinosaurs known to the Wolfram Language:
This gets a list of dinosaurs and gives it the name dinosaurs. The output is automatically shortened because it’s very long:
There are a lot of dinosaurs in the list:
Get a picture of a dinosaur. Try other dinosaurs:
Note: run the code in the previous step first.
This gives the second dinosaur in the list:
Each dinosaur has a wealth of information associated with it, which you can retrieve with EntityValue. Here’s an image of the second dinosaur:
Get the name, an image, and the weight of a dinosaur. Try other dinosaurs:
Get the weight of the second dinosaur:
Get the name, an image, and the weight of the second dinosaur:
Sometimes data may be missing. The weight of the first dinosaur is not available:
Make a table of names, pictures, and weights of random dinosaurs. Run the code again to get different dinosaurs:
Get a random sample of 10 dinosaurs. Run the code again to get a different sample:
Get the name, image, and weight of a random sample of dinosaurs:
Format the dinosaur data as a table:
Sort the table by weight. Run the code again to get different dinosaurs:
Weights in the table are both single values, like , and ranges, like
. To sort the table by weight, you have to first convert the ranges to single values. You can do that easily with a rule that replaces intervals with their average values (their “means”):
Now you can sort the data by weight, which is the last element of each entry:
Make a table sorted by weight:
Share It—Put the dinosaur table online, where anyone can visit it.
Note: run the code in the very first step first to define dinosaurs.
Deploy the dinosaur table to the Wolfram Cloud, where anyone can visit it. The table updates each time it’s visited:
Click the link in the output to visit the site. Refresh the page in your browser to get a new table.
Tell the world about your creation by sharing the link via email, tweet, or other message.