External Services

Analyze Hyperinflation Rates of South American Countries

Connect to the Federal Reserve Economic Data API.

In[1]:=
Click for copyable input
fred = ServiceConnect["FederalReserveEconomicData"]
Out[1]=

Get a list of South American countries.

In[2]:=
Click for copyable input
countries = CountryData["SouthAmerica"];

Retrieve inflation time series from the chosen countries.

In[3]:=
Click for copyable input
data = Association[DeleteMissing[Block[{source, id, ts, fts}, source = fred["SeriesSearch", "Query" -> # <> " inflation consumer price"]; If[Length[source] > 0, (id = source[1, "ID"]; ts = fred["SeriesData", "ID" -> id]; fts = TimeSeries[ts , MissingDataMethod -> Automatic]; # -> fts), Missing[#]] ] & /@ (EntityValue[#, "Name"] & /@ countries)]];

Make a plot of countries with hyperinflation in the 19602015 period.

show complete Wolfram Language input
In[4]:=
Click for copyable input
hyperinflation = Select[data, (Max[#["Values"]] > 1000 &)]; DateListLogPlot[Thread[Legended[Values[#], Keys[#]]] &@hyperinflation, Filling -> Axis, FrameStyle -> White, FrameLabel -> "Logscale of inflation", FrameTicks -> {{Automatic, None}, {Table[DateObject[{i}], {i, 1960, 2015, 5}], None}}, PlotRange -> Full, Background -> RGBColor[0.25, 0.25, 0.25], AspectRatio -> 1/2, DateTicksFormat -> "YearShort", ImageSize -> 480, GridLines -> {None, {{10, White}, {100, Pink}, {1000, Red}}}, GridLinesStyle -> {Thickness[Small], Dashed}]
Out[4]=

Related Examples

de es fr ja ko pt-br ru zh