As of now I have to find the individual lengths of each chemical class in this data set individually, but I was looking for a way that I could find the length of each individual chemical class at once.
Hi
Try this
list = EntityClassList["Chemical"]; EntityValue[#, "EntityCount"] & /@ list
As an Association
Association
AssociationMap[EntityValue[#, "EntityCount"] &, EntityClassList["Chemical"]]
Another option would be to use a singe Map:
Map[ {#, EntityValue[#, "EntityCount"]} &, EntityClassList["Chemical"] ]
then you use Thread for both outputs, here is the whole operation
list = EntityClassList["Chemical"]; len = EntityValue[#, "EntityCount"] & /@ list; Thread[{list, len}]
Thank you both. This is exactly what I was looking for!
Thank you so much! Would it be possible that the numerical values in the output have their corresponding chemical class next to them so it is easier to undestand?