{"id":2571,"date":"2025-03-22T07:02:21","date_gmt":"2025-03-22T07:02:21","guid":{"rendered":"https:\/\/mailitics.com\/index.php\/2025\/03\/22\/what-germany-currently-is-up-to-debt-wise\/"},"modified":"2025-03-22T07:02:21","modified_gmt":"2025-03-22T07:02:21","slug":"what-germany-currently-is-up-to-debt-wise","status":"publish","type":"post","link":"https:\/\/mailitics.com\/index.php\/2025\/03\/22\/what-germany-currently-is-up-to-debt-wise\/","title":{"rendered":"What Germany Currently Is Up To, Debt-Wise"},"content":{"rendered":"<p>    What Germany Currently Is Up To, Debt-Wise<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p class=\"wp-block-paragraph\">\u20ac1,600 <em>per second<\/em>. That\u2019s how much interest Germany has to pay for its debts. In total, the German state has debts ranging into the trillions \u2014 more than a thousand billion Euros. And the government is planning to make even more, up to one trillion additional debt is rumored to follow over the next 10 years.<\/p>\n<p class=\"wp-block-paragraph\">The numbers involved in governmental finances are so huge that one probably cannot realistically assess just how much even 1 billion Euro or Dollar are.<\/p>\n<p class=\"wp-block-paragraph\">In this article, I demonstrate that conventional lists and <a href=\"https:\/\/towardsdatascience.com\/tag\/charts\/\" title=\"Charts\">Charts<\/a> fail to convey a sense of just how much money is at stake when it comes to governmental spending. I then show how <em>a little bit of programming can interactively visualize this money and how it relates to other numbers<\/em>. I will use Germany as an example, as it currently receives a lot of media coverage and its debt statistics are freely available.<\/p>\n<h2 class=\"wp-block-heading\">Plain enumeration<\/h2>\n<p class=\"wp-block-paragraph\">To start, we\u2019ll use plain enumeration of the key facts as the first method to (not) put information into relation. It excludes household debts. As we\u2019ll later see, this simple method utterly fails compared to the visualization tools provided through simple scripts.<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\u20ac1,600: interest rate per second<\/li>\n<li class=\"wp-block-list-item\">\u20ac25,503: debt per German citizen if state debt is split<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">And here\u2019s already a large jump for us. We are directly jumping into the billions:<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\u20ac49,5 <em>billion<\/em>: interest rate per year<\/li>\n<li class=\"wp-block-list-item\">\u20ac100 billion: Sonderverm\u00f6gen (euphemism for debt) for German Army<\/li>\n<li class=\"wp-block-list-item\">\u20ac500 billion: <em>planned<\/em> additional debt for infrastructure<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">Now, we are making another jump:<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">\u20ac2,11 <em>trillion<\/em>: total German governmental debt (as of March 2025)<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">After reading these numbers, we might know a bit more about Germany\u2019s debt. But we hardly have an understanding of how they relate to each other. Yes, we know that \u20ac1 billion is a thousand times \u20ac1 million. But that\u2019s just common sense.\u00a0<\/p>\n<p class=\"wp-block-paragraph\">We would probably fare better if we could see the numbers visualized side by side. That\u2019s what we will do next.<\/p>\n<h2 class=\"wp-block-heading\">Linearly scaled charts<\/h2>\n<p class=\"wp-block-paragraph\">Using python and the Matplotlib plotting library, it is straightforward to create a simple chart. (Complete code is linked in this article\u2019s Resource section at the end).\u00a0<\/p>\n<p class=\"wp-block-paragraph\">I picked four numbers to visualize together: \u20ac1,600 (because most people know <em>just how much already that is<\/em>), \u20ac25,503 (because it nicely shows the hidden debt that any German has), \u20ac1 billion (because that\u2019s a very large sum, something that large companies don\u2019t even make per year), and, finally \u20ac49,5 billion (because that\u2019s how much Germany currently needs to spend just in interest per year <em>which is more than most<\/em> <em>countries\u2019 GDP<\/em>).<\/p>\n<pre class=\"wp-block-prismatic-blocks\" datatext=\"el1742584758468\"><code class=\"language-python\">import matplotlib.pyplot as plt\n\n\n# Data\namounts = [1600, 25503, 1e9, 49.5e9, ]\nlabels = ['Per-sec. interest', 'Per-person debt','\u20ac1 billion', 'Yearly interest']\n\n\nplt.figure(figsize=(10, 6))\nplt.bar(labels, amounts, color=['orange', 'orange', '#03A9F4', '#ff0000'])<\/code><\/pre>\n<p class=\"wp-block-paragraph\">After running this code, we get the following plot:<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" height=\"614\" width=\"1024\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/bar_chart_linear-1024x614.png?resize=1024%2C614&#038;ssl=1\" alt=\"\" class=\"wp-image-599748\"><\/figure>\n<p class=\"wp-block-paragraph\">What we see in an instant: <strong>we don\u2019t see the small money<\/strong>. The huge amounts completely dwarf the \u20ac1,600. I\u2019d wager to say that anybody reading this has more connection to just \u20ac1,000 than to, say, \u20ac1 million. We know what \u20ac1,000 could afford us. A couple of \u20ac1,000 is a good monthly income for most people.<\/p>\n<p class=\"wp-block-paragraph\">But the chart does not even recognize it.<\/p>\n<p class=\"wp-block-paragraph\">Is the mistake that I used linearly scaled axes? Let\u2019s see next.<\/p>\n<h2 class=\"wp-block-heading\">Logarithmically scaled charts<\/h2>\n<p class=\"wp-block-paragraph\">In visualizing the data logarithmically, we\u2019ll stick to python and matplotlib. We merely need to add a single line of code and directly get an updated chart:<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" height=\"683\" width=\"1024\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/bar_chart_log-1024x683.png?resize=1024%2C683&#038;ssl=1\" alt=\"\" class=\"wp-image-599749\"><\/figure>\n<p class=\"wp-block-paragraph\"><strong>Is it better?<\/strong> To some extent, <em>yes<\/em>! We can now begin to see the difference between everyday amounts (like the \u20ac1,600 interest per second) and the planned spending (i.e., debt).<\/p>\n<p class=\"wp-block-paragraph\">Thanks to the logarithmic scaling, they appear on the same chart. In this visualization, the chart does not grow linearly, but logarithmically. This means that the spacing between two markers on the y-axis does not represent a fixed, equal increment (like before in the linearly scaled plot). Instead, each step represents a multiplication by a constant factor. In our plot, the spacing is determined by multiplying with 100 (or, adding two trailing zeros).<\/p>\n<p class=\"wp-block-paragraph\">For our purpose: is such logarithmic scaling better than linear scaling? Yes, definitely.<\/p>\n<p class=\"wp-block-paragraph\"><strong>But, is it sufficient?<\/strong> Can we not do better in trying to convey what Germany\u2019s up to when it plans for \u20ac500 billion of additional debt? And, how does this debt relate to other, already existing debts?<\/p>\n<p class=\"wp-block-paragraph\">Yes, of course we can. Using a little bit of HTML, JavaScript, and some CSS styling, we can quickly create a simple interactive webpage. For a beginner it\u2019s easily doable over a weekend.<\/p>\n<h2 class=\"wp-block-heading\">A static webpage is all it needs!<\/h2>\n<p class=\"wp-block-paragraph\">Data scientists and programmers wrangle with data day-in, day-out. Tools like Excel and python scripts help them with transforming the data to gain insights.<\/p>\n<p class=\"wp-block-paragraph\">Sometimes, however, a simple webpage can convey the relationship between numbers better. Especially when we are talking about the huge sums involved in governmental debts.<\/p>\n<p class=\"wp-block-paragraph\"><strong>We start our visualization in HTML<\/strong>, by stacking a few div-elements on top of each other:<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">...\n&lt;div class=\"debt-wrapper\"&gt;\n     &lt;h2 class=\"debt-title\"&gt;\u20ac25,503 (Debt per German citizen &lt;em&gt;if total governmental debt is split &lt;\/em&gt;)&lt;\/h2&gt;\n     &lt;div class=\"debt one-thousand\" data-height=\"25503\"&gt;&lt;\/div&gt;\n&lt;\/div&gt;\n&lt;div class=\"debt-wrapper\"&gt;\n     &lt;h2 class=\"debt-title\"&gt;\u20ac1 billion&lt;\/h2&gt;\n     &lt;div class=\"debt billion\" data-height=\"1000000000\"&gt;&lt;\/div&gt;\n&lt;\/div&gt;\n&lt;div class=\"debt-wrapper\" id=\"interest-year\"&gt;\n     &lt;div class=\"debt-header\"&gt;\n       &lt;h2 class=\"debt-title\"&gt;\u20ac49,5 billion (German interest per year)&lt;\/h2&gt;\n     &lt;\/div&gt;\n     &lt;div class=\"debt ruler\" data-height=\"49500000000\"&gt;&lt;\/div&gt;\n&lt;\/div&gt;\n...\n<\/code><\/pre>\n<p class=\"wp-block-paragraph\">For each section, we indicate the amount in \u20ac in an HTML attribute.<\/p>\n<p class=\"wp-block-paragraph\"><strong>Next, we will use JavaScript<\/strong> to transform the amounts into an easy-to-grasp-visualization.<\/p>\n<p class=\"wp-block-paragraph\">For this, we define that <strong>each pixel represents \u20ac1,000<\/strong>. By using rectangular forms, we can thus represent any amount of money:<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-javascript\">document.addEventListener(\"DOMContentLoaded\", function() {\n     const wealthBars = document.querySelectorAll(\".debt\");\n     wealthBars.forEach(bar =&gt; {\n       if (!bar.dataset.scaled) {\n         const amount = parseInt(bar.dataset.height) \/ 1000;\n         const width = Math.min(Math.sqrt(amount), 200); \/\/ Cap the width pixels\n         const height = amount \/ width;\n         bar.style.width = width + \"px\";\n         bar.style.height = height + \"px\";\n         bar.dataset.scaled = \"true\";<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Lastly, we add some CSS styling to make the rendered webpage look well:<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-css\">.debt-wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n margin: 20px 0;\n}\n\n\n.debt-title {\n font-size: 20px;\n margin-bottom: 10px;\n}\n\n\n\/* Debt Bars *\/\n.debt {\n position: relative;\n transition: height 0.3s ease-out, width 0.3s ease-out;\n background-color: #ffcc00;\n max-width: 200px; \/* Maximum width for bars *\/\n}<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Putting all of this together (find the full source code in the Resources section below), we get the following (I added further key numbers that I considered relevant in putting the German debt into proportion):<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/contributor.insightmediagroup.io\/wp-content\/uploads\/2025\/03\/german_debt.gif?ssl=1\" alt=\"\" class=\"wp-image-599750\"><figcaption class=\"wp-element-caption\">Visualization by the author. Find it here: <a href=\"https:\/\/phrasenmaeher.github.io\/\">https:\/\/phrasenmaeher.github.io<\/a><\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">Now, that is an easy to understand visualization! You can explore it yourself here: <a href=\"https:\/\/phrasenmaeher.github.io\/\">https:\/\/phrasenmaeher.github.io<\/a>.<\/p>\n<p>This simple webpage more accurately represents the huge amount of fresh debt that Germany wants to make. Using basic <a href=\"https:\/\/towardsdatascience.com\/tag\/programming\/\" title=\"Programming\">Programming<\/a> skills, we show how the debt relates to everyday sums (like \u20ac1,600) and existing debt-related costs (like the \u20ac49,5 billion interest per year). Just start scrolling down, and you get a sense of how much money it is. In the above GIF, we have not even scrolled 1% of the entire way down (look at the scroll bar to the right, it barely moves).<\/p>\n<p class=\"wp-block-paragraph\">Recall that 1 pixel equals \u20ac1,000. Even if you are earning \u20ac10,000 per month, that\u2019s merely 10 pixels, which is barely noticeable in the debt bars. If you scroll just 1 pixel down, you have uncovered \u20ac200,000 of new debt (with the default bar width of 200). Even if you make \u20ac1 million (per year), that\u2019s just a mere scrolling of 5 pixels. However much money you make, the visualization demonstrates:<em> it\u2019s literally a drop in the debt ocean<\/em>. <\/p>\n<p class=\"wp-block-paragraph\">If you are German, I don\u2019t feel envy, especially not for the upcoming generations: somebody has to pay this back. <em>In addition to existing debts.<\/em><\/p>\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dotted\">\n<h2 class=\"wp-block-heading\">Resources<\/h2>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Interactive webpage: <a href=\"https:\/\/phrasenmaeher.github.io\/\">https:\/\/phrasenmaeher.github.io\/<\/a>\n<\/li>\n<li class=\"wp-block-list-item\">All code (<a href=\"https:\/\/towardsdatascience.com\/tag\/python\/\" title=\"Python\">Python<\/a>, HTML, JavaScript, CSS): <a href=\"https:\/\/github.com\/phrasenmaeher\/german-debt\">https:\/\/github.com\/phrasenmaeher\/german-debt<\/a>\n<\/li>\n<li class=\"wp-block-list-item\">Sources for the numbers: <a href=\"https:\/\/github.com\/phrasenmaeher\/german-debt?tab=readme-ov-file#select-sources\">https:\/\/github.com\/phrasenmaeher\/german-debt?tab=readme-ov-file#select-sources<\/a>\n<\/li>\n<\/ul>\n<p>The post <a href=\"https:\/\/towardsdatascience.com\/what-germany-currently-is-up-to-debt-wise\/\">What Germany Currently Is Up To, Debt-Wise<\/a> appeared first on <a href=\"https:\/\/towardsdatascience.com\/\">Towards Data Science<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Pascal Janetzky<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/towardsdatascience.com\/what-germany-currently-is-up-to-debt-wise\/\">Go to original source<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What Germany Currently Is Up To, Debt-Wise \u20ac1,600 per second. That\u2019s how much interest Germany has to pay for its debts. In total, the German state has debts ranging into the trillions \u2014 more than a thousand billion Euros. And the government is planning to make even more, up to one trillion additional debt is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,1034,83,82,166,160,157],"tags":[2093,2092,7],"class_list":["post-2571","post","type-post","status-publish","format-standard","hentry","category-aimldsaimlds","category-charts","category-data-science","category-data-visualization","category-hands-on-tutorials","category-programming","category-python","tag-billion","tag-debt","tag-how"],"_links":{"self":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2571"}],"collection":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/comments?post=2571"}],"version-history":[{"count":0,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2571\/revisions"}],"wp:attachment":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/media?parent=2571"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/categories?post=2571"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/tags?post=2571"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}