2
$\begingroup$

Right now, I'm getting the data in U.S. Dollars and converting it to Euros like this:

CountryData[
  "Mexico", {"GDPPerCapita", All}] /. {x_, y_} -> {x, 
   UnitConvert[Quantity[y, "USDollars"], "Euros"]}

Is there a way to shorten this code or to directly get the data in Euros? If there's a way for both, please post each of them.

$\endgroup$
2
$\begingroup$
euro = FinancialData["USD/EUR"]

0.8139

DateListPlot[
 TimeSeriesMap[#*euro &, CountryData["Mexico", {"GDPPerCapita", All}]],
 GridLines -> Automatic]

enter image description here

Inspect the values with

TimeSeriesMap[#*euro &, CountryData["Mexico", {"GDPPerCapita", All}]]["Values"] // QuantityMagnitude
$\endgroup$
  • $\begingroup$ However, this gives the GDP/capita as measured in contemporary USD, converted into today's EUR. Ideally one should use the historical exchange rates in order to get a more accurate picture. $\endgroup$ – Oleksandr R. Dec 7 '14 at 19:55
  • $\begingroup$ @OleksandrR. True, but there isn't a 1970 exchange rate. As you certainly know the euro was introduced much later. $\endgroup$ – eldo Dec 7 '14 at 20:15
  • $\begingroup$ Well, in case one needs GDP per capita in EUR going back further than 1999 (which may make the question somewhat ill-defined), the exchange rates for the preceding ECU and EUA could be used instead. Alternatively, and probably more meaningfully, the figures can be CPI-normalized and presented in real current EUR. $\endgroup$ – Oleksandr R. Dec 7 '14 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.