3
$\begingroup$

Which of the following syntax variations are correct? For the incorrect? syntax, what does the obtained value represent? Statements 2/3 and 4/5 are identical; I was trying to see if it was a bug.

enter image description here


CountryData["Ireland", "GiniIndex"] CountryData[#, "GiniIndex"] &@Entity["Country", "Ireland"] CountryData[Entity["Country", "Ireland"], "GiniIndex"] #["GiniIndex"] &@Entity["Country", "Ireland"] Entity["Country", "Ireland"][EntityProperty["Country", "GiniIndex"]] 

Thanks for your help.

$\endgroup$
4
  • 1
    $\begingroup$ Maybe the two forms just read data from different sources. $\endgroup$ Commented Apr 23, 2024 at 9:06
  • $\begingroup$ I was trying to do GeoRegionValuePlot with selected properties for various world countries and realized that the colors didn't match, so I reduced it to a MWE. $\endgroup$ Commented Apr 23, 2024 at 9:09
  • 2
    $\begingroup$ 'EntityProperty' probably reads data from Wolfram alpha which is updated more frequently. And CountryData probably reads data from some database that was created when your Mathematica version was released, so it means the data is older. $\endgroup$ Commented Apr 23, 2024 at 9:12
  • 2
    $\begingroup$ See diagram on wolframalpha.com/input?i=ireland+gini+index $\endgroup$ Commented Apr 23, 2024 at 9:14

1 Answer 1

5
$\begingroup$

It looks like CountryData doesn't return the latest data but from a few years ago, so you should use Entity. You can reconsiliate the results by explicitly providing the year.

CountryData["Ireland", "GiniIndex"] (* 0.306 *) CountryData["Ireland", "GiniIndex", "Date"] (* 2018 *) Entity["Country", "Ireland"]["GiniIndex"] (* 0.292 *) Entity["Country", "Ireland"]["GiniIndex", "Date" -> 2018] Entity["Country", "Ireland"][Dated["GiniIndex", 2018]] (* 0.306 *) Entity["Country", "Ireland"]["GiniIndex", "Date" -> All] (* TemporalData[TimeSeries, {...}]] *) CountryData["Ireland", {"GiniIndex", 2024}] (* This should work, but it doesn't ... *) 
$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.