Wither Europa

Press Freedom Index
Corruption Perceptions Index
Corruption Perceptions Index
Democracy Index
Human Development Index

It is becoming more and more popular in international relations and international political economy circles to say “wither Europe”, “Europe is dying” and the like.

Let’s look at this in detail.

Human rights

Using the Press Freedom Index as our metric of freedom, and looking at the countries which have a good or satisfactory ranking:

  • 6 African countries (11%)
  • 2 Asian countries (4%)
  • 27 European Countries (51%)
  • 5 North American/Caribbean countries (22%)
  • 5 Oceania countries (36%)
  • 2 South American countries (16%)

Over half of these countries are located in Europe.

If we look at corruption, we find a similar trend, New Zealand, Singapore, Australia, Canada, Japan, the United Arab Emirates, Uruguay, Bhutan, United States, Seychelles, Taiwan, Barbados, Bahamas, Qatar, South Korea, Botswana, Brunei, Israel, Saint Vincent and the Grenadines, Cape Verde, Costa Rica, Dominica, Oman, Rwanda, Grenada, Mauritius, Saudi Arabia, Malaysia, and Namibia have scores above 50. Out of these 59 countries, 30 of them are in Europe.

A similar trend.

Out of 53 countries which are arguably in Europe (including Georgia, Armenia, and Turkey) half of them score as some of the freest countries in the world by both metrics. It is the only “continent” in the world where over half of its countries are ranked as among the world’s most free.

When it comes to Democratization, there are many countries classified as flaeed democracies by the Economist Intelligence Unit in Latin America, but when it comes to Full Democracies, Western Europe is one of only two regions with an average score over 8, the other one is North America consisting of only the United States and Canada.

Population

Is this because of having a large number of small countries?

There are X countries with a population under 1 million people, and 10 of them are in Europe. Europe’s population is the 3rd largest “continent” with 750 million people, behind only Africa and Asia. Europe is larger than North America in terms of both population and GDP. No one is seriously projecting that the United States is going to stop being an important player in the world, see the GDP plot above.

It is clear Europe will be a critical region in the world because of the large population for as far as anyone can reasonably predict.

Economics

Keeping in mind that Europe has 53 countries, out of the top ten countries by GDP (PPP), 4 of them are in Europe, 4 are in Asia, and 2 are in the Americas.

Out of the top 10 countries in the world by GDP per capita (PPP), 6 of them are in Europe, 4 are in Asia, and one is the United States. The next 5 countries are also in Europe. So out of the top 15 countries by GDP per capita, 3/4 of them are European.

The 75th percentile for the world’s countries by GDP per capita is around $15,000. 21 of these countries are in Europe, 9 are in Asia, 4 are in the Americas, 2 are in Oceania, and 1 is in Africa.

If we get the average GDP per capita for Africa, Asia, the Americas, Europe, and Oceania, Europe has a GDP per capita of $30000, and Oceania has a GDP per capita of $37,000.

Europe hits that sweet spot between having a large population, a large economy, and a high average quality of life which is unique in the world today.

Asia might someday catch up to Europe though. China has a GDP per capita 1/4 that of Europe, and 1/5 that of Western Europe.

If China manages to grow their GDP per capita at an average of 6% per year, and Western Europe grows their GDP per capita at a rate of 2% per year it will take them 43 years to have a GDP per capita the same size as that of Western or Eastern Europe. This is of course assuming constant growth rates. If China’s growth rate slows to a more normal average for developing economies, it might not happen for another 80+ years, long after I expect to be dead. Only people who are children today might be able to see the day where China’s average quality of life is on par with that of Europe.

Europe’s quality of life is going to be better than that of most of the world for a long time to come.

Of the 15 largest military expenditures in the world, 5 of them are in Europe, comprising 13% of global military expenditures. This is one place where Europe pulls just about where you would expect, with roughly 10% of the world’s population, they comprise over 13% of the world’s military expenditures.

We can also look at political power rankings as calculated by US News, and we see the US at number 1, then China at number 2, followed by Russia, Germany, and the United Kingdom. No country in Africa, South America, or Oceania make the list, 5 countries in Asia, 1 country in North America, and 3 in Europe.

It doesn’t matter how you look at, if you take GDP, GDP per capita, military expenditures, quality of life, or just cut to the chase and use US News’ political power rankings, several European countries still rank as some of the most powerful countries in the world, and the rest of the peninsula is comprised of countries with strong economies which when unified as a single bloc are a force to be reckoned with.

China Supreme?

In 1900, the largest country in the world by population was China, like most of human history. Europe dominated the world however, with most of Africa colonized, and the European continent held 8 of the world’s 20 largest countries by population. Over 1 in 5 people were subjects of the British empire, and Europe dominated the world economically and politically.

The 20th century saw a rapid decolonization across the planet, and the majority of countries which were decolonized were extremely poor, and many were dictatorships for the rest of the 20th century. With a few notable exceptions, while colonization was obviously bad for many reasons, local government did not mean that the quality of life for the people in such countries improved, corruption and poverty were the norm in the wake of decolonization.

But now things are starting to change. Several countries are solidly middle income, most countries in the Americas are classified as flawed democracies by the Economist Intelligence Unit. China is seeing rapid economic growth year after year, and several petrostates in the Middle East have became incredibly wealthy.

The world is a different place than it was 50 years ago, and while many countries have developed, and many countries have seen an expansion in liberty, if we look across multiple metrics of not just pure power but also freedom, because what good for a business is a giant population if most of them are in poverty? If we filter for low corruption (top 25% only), high democracy score (over 7) and a high GDP per capita (top 25% only), we find the following map:


There are 9 countries outside Europe which fit this description, and 22 countries which are European which fit this description.

However, what if I don’t care about human rights, I just want to see countries which have the largest economies and the highest average quality of life (using GDP per capita)?

Again we see a familiar pattern. North America, most of Western Europe, Australia, Japan, and South Korea are the only ones which are in the top 25th percentile for both population and GDP per capita.

We are seeing that for countries which have the most flexibility, Western Europe still dominates, without any filters for human rights. The top ten power rankings from US News match this, with adding in China and Russia because of their large populations, and Saudi Arabia and the United Arab Emirates because of their vast oil reserves. But Saudi Arabia and the United Arab Emirates are heavily reliant on oil exports, an embargo on either one would destroy their economy quickly. Russia is a petrostate as well, and if Western Europeans managed to move off of natural gas to heat their homes, Russia would lose a large amount of its economic base. China is starting to diversify, but most of their technological growth is not from new inventions but by copying inventions done by the United States in flagrant copyright violation. The rest of the powerful countries are heavily diversified knowledge based economies where the inventions occur, with large domestic consumer markets. If China, Russia, the UAE, or Saudi Arabia were to alienate the world they would quickly find that their economies would quickly dry up.

Europe is the world’s largest consumer market of consumers who have lots of money to spend. We live longer lives, have better health care, and are happier overall.

China is able to flex their muscles because they are large. Russia is able to flex its muscles because of how the world’s oil infrastructure is built gives them a tremendous advantage in terms of selling petroleum based products to Europe.

But both of these countries honestly punch below their weight. The European Union is the largest trading partner of the United States, with 18.7% of exports, and 18.9% of imports. China does produce 21.4% of imports to the United States, but this is relatively proportional to the percent of the world’s population in China. The EU however is punching above their weight, with 6% of the world’s population they trade with the United States with a percentage of our trade 3 times larger than their population would predict. If the European Union or some other country had a population on par with China, they would absolutely dominate imports and exports with the United States.

The same story for  the European Union, China again is the source of about 22% of imports to the EU, on par for their percent of the world’s population. The United States on the other hand with about 4% of the world’s population is the destination for 18% of exports from the European Union, and the source of 11.8% of imports send to the EU, far above our weight based on our population alone. Even Russia has imports and exports of 4-5% of European imports and exports, despite having only 2% of the world’s population. That is also while sharing a border with the European Union. This seems impressive on the surface…

What happens when two strong developed economies share a long developed border in terms of imports and exports? We don’t have to wonder because that is the case of the United States and Canada. Canada has 0.4% of the world’s population, yet is the destination of 18% of exports from the United States, and the source of 12% of American imports.  Canadian imports to the United States pull weight 30 times their size! China having imports and  exports on par with their population doesn’t seem so impressive when you take their size into account.

Despite having the world’s largest economy, China’s government consistently fails year after year to leverage this in the global economy to really achieve their true potential. China should be able to amass a massive economy of scale to absolutely dominate imports and exports with other large economic blocs around the world, but they can’t seem to do it. Given that they have 1/4 of the world’s population they are far smaller than they really should be. India may be the world’s second largest country, but they don’t even appear on the brief summaries of imports and exports to the United States or Europe because they are underdeveloped.

Despite having a population around 1/3 the size of China, the European Union consistently is able to trade with the United States on par with China. Despite having a population only 2% of that of China, Canada is able to have 25x the trade with the United States one would expect based on their size alone.

China is significantly under performing compared to where they should be.

Now, even though I know that Economists have successfully predicted 5 of the last 2 recessions, I’m going to take a stab at what is likely to happen in the future.

There are two paths. If China continues to lag in corruption perceptions index, they will likely continue to see their gini coefficient rise. It is already higher than that of the United States. Corruption increases inequality and poverty, which needs to be dealt with soon. If China is to really pull their true weight in the global economy they need to deal with internal problems like income inequality and poverty. Corruption has a negative impact on growth as well according to Transparency International.

Challenges to Chinese economic growth going forward are numerous. As China’s economy grows it will need its currency to appreciate in value. As more Chinese families start to have middle class lifestyles, they will want to import expensive goods from abroad. China’s currency policy makes these imports more expensive, and this will eventually slow growth. At a GDP per capita of only $10,000 China has already seen its working age population peak, which means more of its money is going to need to go to take care of elders than has been in the past. Chinese productivity is behind that of highly developed nations. There is also evidence that Chinese economic growth over the last decade was actually around 4% APY.

Source: Challenges to China’s economy

If Chinese economic growth is indeed already at 4% APY, and Western Europe grows at 2% APY, then it will take China 85 years to catch up with Europe’s economy.

It becomes clear that while China will continue to be the world’s largest economy, they continue to punch below what their weight would imply compared to how highly developed nations perform in terms of exports.

Towards a multipolar world

I do not foresee a future where China is the world’s dominant super power. The US and EU, despite having fewer people than China will continue to have significantly more economic and foreign power, particularly when we work together.

But one thing which is definitely shifting is that Eastern Europe is becoming more democratic, joining the European Union, and developing economically. The shift of Eastern Europe from being members of the Warsaw Pact to being members of NATO and the European Union has created a massive shift in terms of the balance of power for the world. When the United States and European Union work together on international economic aims, we are far more powerful than China, despite our smaller population.

During the Cold War, Eastern Europe was part of the Warsaw Pact, they were poor, and had little real power beyond themselves. The Soviet Union had a large population, and a stronger economy than China which was still recovering from the Great Leap Forward until the 80s and 90s, but as soon as the Soviet Union broke up and lost Eastern Europe, Russia by itself didn’t have enough clout to be a major world player beyond being the main source of natural gas for Europe. Western Europe’s population by themselves wasn’t large enough to be a major power without Eastern Europe joining, and given that Spain was recovering from Franco, Europe was still reassessing its place in the post-colonization world from the 1960s to 1990s.

But times have changed. There are three main powers in the world today:

  • The United States, the world’s largest advanced democracy by a long shot
  • The European Union, the largest trading bloc in the world
  • China, The world’s largest population, but a relatively poor economy considering its population

What we are going to see is the world forming where multilateral international relations are going to be more important. Combined, the European Union is a force to be reckoned with, and China has power just through sheer population.

But the United States is by far the most powerful individual country in the world. We have the world’s most powerful economy, semiconductors, the hardware behind most of today’s modern innovations, are all based here in the United States. The United States publishes more scholarly articles than any other country except China, at 4 times China’s rate per capita. There are three main operating systems people use today, Linux, Macintosh, and Windows. All three are American. Of the 10 largest companies by market capitalization, 8 of them are American. 4 of them are headquartered in Santa Clara county, California. America’s GDP per capita and HDI are extremely high. Out of highly developed democracies, the United States is an outlier. Despite all of this we have some problems we need to deal with, racism, inequality, and relative lack of opportunity for low income Americans exemplified by the student loan crisis.

But it is obvious that if there is any one country which has the population, economy, and global influence to be the major player of the 21st century, there is one obvious answer.

The United States of America.

Policy Scoreboard

As I woke up this morning, I got an idea, what if there was an easy way to rank a policy on whether it should be passed and can be passed. As I was thinking about student loans, BBB, and BIF, I made this graph:Think of it this way:

  1. Impact on people’s lives, positive would be how directly does it impact the average person. We are looking for both how much does It impact someone, and whether it makes peoples lives better or worse.
  2. Good, how positively does this impact society as a whole.
  3. Easy to pass. How many barriers are there to turn this idea into a law? at the top there is a special category for executive orders, which are by far the easiest. A low score doesn’t mean a politician shouldn’t pursue a policy, it just means it will take more time and could come with a high opportunity cost.
  4. Impact on approval, how much will this impact the public’s perception about whether their government is doing a good job or not? A positive score will impact overall approval rating, a negative score will hurt the overall approval rating. Only count scores as they impact over the short run for this, a policy which will turn massive benefits in the long run but no benefit in the short run will be obviously good, but do little to help the next election.
  5. Quick to implement. Once this law is passed, how long will it take to implement the provisions of the law?

I’m going to score a few famous policies, from a scale of 0-100 using this ranking system I have come up with:

  1. PATRIOT ACT
    1. Impact on people’s lives: 0, no major improvement in safety, harms privacy
    2. Good: 0, it harmed American civil liberties
    3. Easy to pass: 90, Congress ate it up, so it was very easy to pass
    4. Impact on approval: 90, Bush’s popularity reached record highs which helped propel the Republicans to keep government in 2002
    5. Quick to implement: 90, it only took a few months to implement the new airport security rules
    6. Overall verdict, a short term fix for popularity which caused long term pain
  2. Student loan forgiveness, ending the student loan crisis:
    1. Impact on people’s lives: 90, it will significantly help young college graduates financially who didn’t have enough money to have their parents pay for everything, but too much to qualify for enough aid
    2. Good: 99, It is the closest thing to reparations which can be done without congress, it will stimulate the economy, it will reduce inequality.
    3. Easy to pass: 100, it can be done through executive order, it gets a perfect score
    4. Impact on approval: 90, Biden’s approval among will massively increase among millennials.
    5. Quick to implement: 100, it will immediately reduce the amount of student loans owed by all borrowers by $50,000
    6. Overall verdict: this policy needs to pass, it will provide benefits in the short term and the long term, and help improve Democrat’s approval rating. No other policy has such a good positive balance
  3. Universal childcare
    1. Impact on people’s lives: 99, it will increase the number of people in the workforce, preschool is demonstrated to give massive long term benefits to the people who participate in it as children.
    2. Good: 100, it will benefit the economy in the short run and the long run. Increasing household income will increase how much people can invest, which will provide long term benefits to families and the economy. It will reduce inequality. This is one of the best possible policies.
    3. Easy to pass: 50, as large budget item, its unclear how Manchin and Sinema will vote for it.
    4. Impact on approval: 90, millions of parents being able to go to work because their kids have access to preschool will be a big benefit to the Democrats.
    5. Quick to implement: 90, it hopefully will start sending out payments to parents quickly,
    6. Overall verdict, this should pass, but it faces significant hurdles in congress

So here are how three famous policies can be judged using these metrics. Use this tool yourself and really think through about how any individual policy should be scored using these metrics. Prioritize the ones which come with the highest score across all 5 metrics to get some quick, easy, impactful wins, and work down the list. It’s easier to get people to volunteer, phone bank, and lobby when they know that a politician is on their side, harness those political capital benefits early, and you will have more to work with when you are fighting for harder policies. If you skimp on the easy stuff, people will see you as insincere, and are less likely to volunteer. If people don’t see the benefit to a policy, they are again less likely to volunteer.

Merry Christmas, and a happy new year as the second half of the 117th United States Congress begins.

How social media works

Facebook: Only 5000 potential friends. You need to create your own page and build from the bottom to do anything. Your content gets quickly buried and forgotten.

Twitter: Make a post saying something like “politicians need to follow through on promises.” after years of working in and studying politics. They tell you to take a civics class.

Reddit: Make a post which is well thought out, has to do with a particular topic on a subreddit, and share it. It gains traction quickly. As soon as it really starts taking off a mod removes your content. It’s over.

Basically, if you find a creator you like, you need to subscribe via RSS.

Biden’s student loan memo

Student debt cancellation memo

This image has been floating around the internet for the last few months, and it is a redacted memo which contains legal advice for the President on what the president’s powers are regarding student loans.

Here’s what we know

  1. The President has chosen to not pardon student loans.
  2. Harvard law says the President has this power
  3. This memo is another document stating the President’s power on the issue which has been redacted by the President at his sole discretion.

So what combination of factors could we have.

Well, the memo either says the President does have this power, or it says he doesn’t. There is no middle ground.

The president is claiming he doesn’t.

So what does the memo say?

Simple proof

This is the type of problem which is what game theory is used for. Let’s draw the game.

The President chooses to forgive The President chooses not to forgive
Memo agrees with Harvard Law President should show the memo, it supports his decision The President should not show the memo since it disagrees
Memo disagrees with Harvard Law The President should not show the memo since it disagrees President should show the memo, it supports his decision

Why is this the solution? Well, if one of the top lawyers in the US government agree with the President, then the President should show us the document to support his decision. It will strengthen his case.

If it disagrees, he should not show that one of the top lawyers in the US government disagrees with his decision, as it will make him look like he doesn’t care. It weakens his case.

It’s really not that complicated.

More extensive proof

The bigger game theory table looks like this:

Memo says the action is legal Memo says the action is illegal
Forgive Don’t forgive Forgive Don’t forgive
Show the memo 1 -1 -1 1
Hide the memo 0 1 1 0

There are only 3 variables at play:

  1. What does the memo say?
  2. Should the President show the memo?
  3. Will the president forgive student loans?

Since we know that the President will not forgive Student loans the table collapses to the following:

Memo says the action is legal Memo says the action is illegal
Show the memo -1 1
Hide the memo 1 0

and since we know the President is hiding the memo we know the table looks like this:

Memo says the action is legal Memo says the action is illegal
Hide the memo 1 0

Which means that the memo must say the action is legal, the President knows he has this power, and he is lying.

Updated Presidential Rankings

Ranking of American Presidents

I am only ranking Presidents who have served for at least 365 days. With Biden’s latest announcement that he won’t pardon student loans, and since Joe Manchin is almost certainly going to vote against it with every (other) Republican, it’s close enough for me to add Biden to my rankings. I don’t anticipate anything will change over the last month. Biden has made it very clear to me that he will stand for people who didn’t vote for him before delivering policy items Joe Biden promised. I’ve seen enough to make a ranking.
  1. Lyndon Baines Johnson – For his efforts on combating poverty, willingness to lead the country with his bully pulpit, and signing the civil rights act. His Great Society lifted millions out of poverty. No president comes close to his astonishing human rights record. Vietnam escalated under his presidency but he did everything in his power to end the conflict. He had the ability to get people to do what had to be done. His biggest blunder was not letting Americans know that Nixon was committing treason.
  2. Abraham Lincoln – for his effort in keeping the United States together and the Emancipation Proclamation. He respected the constitution with the suspension of Habeas Corpus. He didn’t free slaves in the North.
  3. Franklin Delano Roosevelt – For his efforts and success in setting a strong foundation for the 20th century economy. Banking regulation kept the economy relatively stable for half a century until it was repealed, especially compared to before his Presidency. He created the WPA. Massive expansion of electricity to millions of households. He fought Nazis. He is demoted because he was responsible for the incarceration of thousands of Japanese Americans.
  4. John Fitzgerald Kennedy – For his efforts towards science and combating poverty, and the second best human rights record in our history after his successor, but blundering foreign policy. He set the stage for LBJ’s accomplishments.
  5. Barack Obama – For his efforts towards universal health care, ending the Iraq war, didn’t start new wars but didn’t lose any either, improving education, environmental regulation, he harmed Social security benefits which bought OASI more time, passed historic financial regulation, and was the second most progressive social issues president in history, opened travel to Cuba, gay marriage, and campaigned for free community college.
  6. John Quincy Adams – For his economic wisdom, respect of Native Americans, establishing colleges, abolitionism, and expanding infrastructure. He was 100 years ahead of his time with the policies he signed into law.
  7. George Washington – for his formation of treaties and respect of Native Americans. He ranks lower for signing the Fugitive Slave Act. He set standards and norms for the Presidency which made our country successful. He was masterful in his navigation of foreign relations which protected the United States from foreign invasion for our first 20 years.
  8. Warren G. Harding – for supporting the 8 hour work day, child labor laws, opposition to lynching, and good neighbor policy
  9. Benjamin Harrison – For his advocacy of civil rights, reformation of the civil service.
  10. Thomas Jefferson – For his exploration of the American west, preserving trade in the Mediterranean, and diplomacy, ranks lower because of slavery.
  11. Dwight David Eisenhower – For his diplomacy, protection of the economy, and prophetic farewell speech. He set in motion the careers of Nixon and other high ranking Republicans who would later harm America, which is why he ranks lower.
  12. Harry Truman – For his continuation of building the foundation for the 20th century his predecessor built. He is ranked lower for his dropping of the bombs. He helped escalate the Cold War, but  that’s a complicated issue.
  13. Ulysses S. Grant – For his continuation of Reconstruction and supporting equal rights. Corruption was rife in his cabinet.
  14. Theodore Roosevelt – For his valiant efforts in preserving America’s treasures and national parks, he is ranked lower for his interventions in Latin America.
  15. William McKinley – He advocated human rights at home and abroad.
  16. Martin Van Buren – his cowardice in face of anti-Mormonism which he opposed demotes him, he kept peace with Mexico, advocated free trade, and opposed slavery
  17. Zachary Taylor – He attempted to set up the Western states as free states
  18. Chester Alan Arthur – For his signing of the Pendleton Act which put rules against favors, he opposed Mormon polygamy (bad), opposed racism against the Chinese (good), and favored better relations with Native Americans.
  19. James Madison – he opposed the national bank which hurt our economy, he started the War of 1812, and protected Native American treaty rights.
  20. James Earl Carter – for his strong efforts towards peace around the world and attempts to gain energy independence for America. However, he signed the establishment of the NSA.
  21. James Monroe – He started the Seminole Wars, did the Missouri compromise meaning each slave state had to be matched with a free state, his expansionist Monroe doctrine,
  22. John Adams – His largest accomplishment was the Alien and Sedition Acts
  23. Joe Biden – He passed a stimulus at the beginning of his presidency, but didn’t enforce rules to end the pandemic, which became worse over his first year. Lost Afghanistan to the terrorists which meant it became one of the least free and most tyrannical places in the world. Infrastructure privatization. He restarted student loan payments. He refused to listen to experts in any field, and focused on compromise. Aiming for the average policy made his Presidency average in terms of accomplishments. Unity.
  24. Bill Clinton – he passed no great laws and he signed the Commodities Futures Modernization Act, DOMA, DADT, and failed to pass meaningful health care reform. But he balanced the budget and didn’t hurt Medicare, which prevents him from falling further. He was led by pollsters and didn’t lead, he followed.
  25. James K. Polk – He was extremely expansionist,
  26. Woodrow Wilson – For his breaking his promise on World War I, anti-German sentiment, his support of the League of Nations keeps him from falling farther.
  27. Gerald Ford – environmental regulations, strengthened AMTRAK, but he pardoned Nixon which set in motion future Republican extremism and set a precedent that the President is above the law.
  28. Grover Cleveland – He was racist, opposed labor rights, and was an imperialist
  29. Herbert Hoover – He was obsessed with the deficit, created protectionist policies, and had a limited response to the great depression.
  30. Calvin Coolidge – His small government rhetoric and lack of leadership made his Presidency unsuccessful albeit popular. He is totally insignificant.
  31. William Howard Taft – He attacked President Roosevelt’s environmental policy
  32. Richard Nixon – EPA, improved relations with China, set up AMTRAK, worked against the Vietnam peace agreement which was treason. He entered office and destroyed the economy with deflationary monetary policy.
  33. John Tyler – His refusal to form a national bank in the face of an economic collapse drove America further into depression.
  34. Franklin Pierce – His unsuccessful compromise with the Kansas-Nebraska Act set the stage for the Civil War.
  35. Rutherford B. Hayes – He ended Reconstruction
  36. Andrew Johnson – He opposed Reconstruction
  37. Millard Fillmore – He passed the Fugitive Slave Act
  38. James Buchanan – His unwillingness to use his power to keep the Union together led us into civil war.
  39. Andrew Jackson – His deportation of Native Americans, and his fiscal policy which crashed the economy makes him one of the least successful presidents we will ever have.
  40. George H.W. Bush – For vetoing every good bill that came his way and using the United States military for his personal financial benefit (an oilman used the US military to defend a major oil exporter with dreadful human rights, I’m sure there is no conflict of interest.) He was corrupt to the core.
  41. Ronald Reagan – For negotiating with terrorists to hold Americans hostage until he was President, selling arms to Nicaraguan terrorists, attack on Grenada, and deregulation of the financial sector. As soon as he entered office he destroyed the economy with deflationary economic policy. His negotiations with the Mujahideen in Afghanistan betrayed America, making his administration a literal state sponsor of terrorism. He created the highest inflation rate since World War II and highest unemployment from 1950 to 2019. Utter disaster.
  42. Donald Trump – Made America’s tax code more regressive, constant racist rhetoric, first President to restrict American travel to another country in decades, trade war with China, shutting down the government because Democrats won’t give him everything he wants. He paused student loan payments, the only good thing out of his terrible presidency. Most of his policies except his tax code were done through an executive order, so
  43. George W. Bush – He attacked Iraq, destablized the financial markets, the PATRIOT ACT, No Child Left Behind Act, and the Real ID Act meant that he made a negative impact on America’s liberty, prosperity, and standing in the world for a longer period of time than any other President in American history. All of his major bills are still law to this very day.

Starting with Python (or really any object oriented languge)

So let’s say you are starting to program in Python, and you want to know how to start. What do you need to do?

Virtual Environment

Well, the first thing you need to do is install a virtual environment. There are two ways to do this:

  1. Install Anaconda. This provides you with a virtual environment with one command, along with several other features.
  2. Setup a virtual environment

If you are brand new to Python, please use Anaconda. It has everything you need. You download the installer from their website and run it. Restart your terminal, you’re good to go.

Let’s say for whatever reason you don’t want to use Anaconda. You still need to run a virtual environment. To do this on Linux, run the following commands:

  1. Install virtual environment for your distribution. For Ubuntu (or really any Debian based Linux) the command issudo apt-get install virtualenv. If you’re not using a Debian based distro, look it up online if you don’t know the name of your package manager.
  2. In your home directory, create a virtual environment using the command virtualenv linuxtest (name it whatever you want)
  3. Set the virtual environment to activate when you start your terminal paste echo 'source ~/linuxtest/bin/activate' >>~/.bashrc in your command line.
  4. Type source ~/.bashrc in order to activate your changes.

That’s it! Restart your terminal. You will see (linuxtest) before your username in your terminal, assuming you don’t have a custom terminal display. This means it worked.

If not, you either have customized your kernel at some point, or it didn’t work. If you type which python you should see /home/YOUR_USERNAME/linuxtest/bin/python. If you don’t see that, type sudo rm -r ~/linuxtest and try again.

But what’s the point?

Linux uses Python as part of how the Operating system is built. Because of this, the package manager modifies your root python installation. It will download, remove, and update any package it needs to do in order to keep your linux working. If you start upgrading, downgrading, or installing new packages, the best thing that could happen to you is that a package you use will be modified. The worst thing that could happen is you might fundamentally change a package which your operating system needs, and you could break Linux!

Don’t let this happen to you. If you wouldn’t download and run random executable files with names like va5e%smr2-09sd.exe from random websites with terrible graphics, you should use a virtual environment. Don’t screw up your operating system.

If you would run va5e%smr2-09sd.exe, then please stop doing that.

Pip

Python has its own package manager called pip. This is how every python package is packaged and distributed. In your terminal window, if you want to install any package, lets use Pandas as an example, just type pip install pandas into your command line.

That’s it.

If you aren’t using a virtual environment, start using a virtual environment.

If you are using python as root. Stop using python as root.

Update all packages

Now that you have used pip, what if you want to ensure all of your packages in you virtual environment are up to date? Well, for that I have a special alias on all of my machines which is alias pipupgrade='pip list --outdated --format=freeze | grep -v '\''^\-e'\'' | cut -d = -f 1 | xargs -n1 pip install -U. Paste this into your command line. Any time you want to ensure your packages are up to date all you need to do is type pipupgrade into your command line and you are all set.

Which version of Python should I use?

You should use the latest version of python in your virtual environment. You can get away with the version prior to the latest release. So right now that is python 3.10. If you’re using Python 3.9, no problem. You can even get away with Python 3.7 right now, because Python has had a 5 year support cycle for the last decade. Please check wikipedia to make sure the version of python you have installed is currently supported. That way you get the latest features, security updates, and practically all libraries will work on your machine.

Because you are using a virtual environment it doesn’t matter which Python version your operating system is using, you can use any version of Python supported by your operating system in your virtual environment, and that’s the interpreter you will be using when you run things from the terminal.

If your operating system can’t support a version of Python which still gets security updates, its time to update your operating system. For now, just use Ubuntu and upgrade to the latest LTS every October of an even numbered year.

You could even setup multiple environments if you want to test against different versions of Python. That’s up to you.

Pep 8. Who cares?

Python is a very opinionated language. It also uses spacing as part of how the programming language runs code. Because of this, its very important to make sure your code is written properly. Pep 8 is built into modern linters to make sure that your code will be legible, work the same way everywhere, and be consistent. Use it.

Once you have your virtual environment setup, Pip is working, your code is Pep 8 compliant, and you have a version of python which is currently supported running on your computer, write whatever you want. It will work on other modern Python environments, and you don’t have anything to worry about.

Don’t hide errors, fail fast, fail when necessary

If you are writing python code and you find something fails, don’t just hide it in a blank try except clause like the following:
try:
print('hello world')
except:
pass

This practice provides no useful debug information to your user. While print(‘hello world’) is an incredibly simple program, with more complex programs this can become a very real problem. This wastes the time of your users, it creates unstable projects, and it’s just disrespectful. If you user puts in an input which your package can’t read, fail the program, tell them what the problem is, and make it so they can fix the problem quickly.

There are times where a try: except: clause is useful. In that case, specify which types of errors are appropriate to pass on. Ideally write your code so instead of simply failing it gives useful feedback to your program which will be more stable.

Read good code

Writing code is the best way to learn how to write any language. But reading code is an important part of learning how to write a language so its legible. Go through some of the packages you download and try to understand why the library is written the way it does. Compare the structure of your code to the structure of frequently used libraries which are the heart of the language. If you understand how they are written, your own code will improve.

Hierarchy of loops

Python is not C. Python offers several major types of loops which allow you to loop through code. When I write code I write them in the following preference:

  1. result = [x**2 for x in original_list] Python has list comprehensions. The advantage to list comprehensions is that it is done in place, and it automatically saves to a variable in one line. If you were to do this as a for loop it would take a minimum of  three lines, where each line is very short. Once you are used to list comprehensions, you will prefer them. They are everywhere in good code. Get used to them.
  2. for x in y: print(‘x’) If you can make it work in a for loop. Use a for loop. If you can write in a single line in under 120 characters, use a list comprehension. For loops have a build in stopping point, they will not go on forever. This means your code won’t look like its working when in fact it has crashed.
  3. if x % 2: print(‘even’) else: print(‘odd’) If you need to do one thing under one condition, and another thing under another condition, use an if else loop.
  4. try: x except ValueError as error: raise error If you absolutely must use a try loop, make sure it prints the exception, except if there is a very good reason not to. If you can do it as a for loop, use a for loop.
  5. while x: print(time.now()) You probably don’t want to do this. You must be careful and build in a break statement. You probably just want to use a for loop. The advantage to a for loop is that if you miss the break condition the while loop will go on forever, with no error code. The for loop has a built in stopping point when the end of the list is reached. Only use this if every other option cannot be used.

This is my preference based on experience.

Write your own Pip package

You’ve been writing Python for a while now, you are comfortable with the language, and are writing complicated scripts. You might even have written something other people might want to use. Now is the time to do the next step in improving your Python journey, and improve your skills further. The best way to really solidify your python skills and solidify your understanding of the language is to write your own package for Pip. Follow the instructions at packaging.python.org step by step and install the wheel which is created at the end of your tutorial in a virtual environment. If it loads without errors, that means you can write code which is easy to read, and will run the same place everywhere.

There are many benefits to packaging your project and loading them as a library. Pip will tell you when major errors occur immediately. Pip will automagically make sure all dependencies are installed and give clear errors if they cannot be solved. It’s the easiest way to move your projects between different computers.

It helps you write better code.

Once you have mastered the basics, learn how to make a pip package.

How to win the midterms

There are several ways to win elections in American politics, and successful strategies are opposite depending if you are in power or out of power. Other impacts outside the control of politicians (such as media bias) can impact election outcomes, but ultimately politicians will collectively determine their fate.

When you are in power, you want to do the following:

  • Improve quality of life.
  • If the quality of life has improved, make sure the ads tell people that their life has improved.
  • Don’t ask. Tell. Asking gives people the opportunity to say no and question whether what you are saying is true. Only ask if you are absolutely confident what the answer will be, like Reagan’s campaign against inflation in 1984.
  • Pass policies which help as many people as possible. Improve the standard of living for the voters you need in order to keep power. This is the most important one of them all. Do everything you can.

When you are out of power, you want to do the following:

  • Make it very clear how you are different from the incumbent. Especially if there are serious problems impacting people’s lives.
  • Point to successes the last time your party was in power.
  • Point out inherent inequities, and problems which average people feel. Doesn’t matter if the incumbent has anything to do with it. If the incumbent did harm the country, even better for you.

None of this is really that complicated.

The Republicans are already doing everything they can from the third list. They are pointing out every problem with the economy, and they will keep talking about it incessantly until they get back power. Democrats should learn from this. Republicans are able to win on a platform where almost every policy is significantly unpopular because they are relentless in their pursuit of power.

But this is not relevant right now for Democrats.

There are several major midterms relevant for the 2022 election to look at historical results. We need to look at elections similar to the first midterm of a president who flipped the Presidency to their party. Elections which count are 2018, 2010, 2002, 1994, 1982, 1970, 1962, 1954, and 1934. There are several variables at play which make an impact:

  • Are the majority of Americans still angry at the other party for some reason?
  • Has the quality of life significantly improved since the Presidency flipped?
  • Has the incumbent President passed a major bill since being elected?
  • Is the messaging from the party on point? Is there something for the canvassers to talk about which people already know about?
  • Which parties are actively campaigning in as many places as possible?

Really it comes down to this. If all your canvassers have to do is point to a successful policy which everyone knows about and is popular, and claim credit, you will probably do well. If anger towards the other party is still high from the last time they screwed everything up, your job is also easier. These are the ideal ways.

A policy which will start improving lives in the future will not impact peoples votes in the next election. Politicians need to win elections in order to enact policy.

Not financing canvassers is surrender.

Let’s analyze historic elections with these factors:

  • 2018:
    • anger is directed towards Republicans.
    • quality of life is the same as when Obama was in power.
    • No major legislation, though one highly publicized failure with the ACA still being law. The ACA is popular now because its in effect.
    • Not much for Republican canvassers to talk about. Lots of outrageous comments from Trump which make people angry.
    • Democrats have new leadership. The 50 state strategy is mostly back.
    • Democrats win
  • 2010:
    • Republicans are busy pointing out how Obamacare is the end of capitalism.
    • Quality of life is improving, gradually. Unemployment is declining from its early 2009 peak.
    • ACA has passed, but most sections won’t come into effect until 2014. You can’t campaign on maybes and possibilities.
    • Aside from banking regulation, all Democratic policies will be implemented in the future. People haven’t felt the impact of Obama’s policies yet.
    • Democrats have new leadership. The 50 state strategy is out, Tim Kaine is highly focused on a handful of states.
    • Republicans win.
  • 2002:
    • Republicans are busy portraying America as safe from terrorist attacks with bipartisan legislation which passed.
    • Economy has recovered from the dot com bubble.
    • Republicans focus on safety and security in the new surveillance state.
    • Democrats voted for all of Bush’s policies. They have nothing to show how they are significantly different.
    • Republican leadership campaigns in as many places as possible.
    • Republicans win.
  • 1994:
    • Democrats to date have never clearly pointed out that the highest unemployment rate from 1960-2019 was in Reagan’s Presidency. Most people won’t know if you don’t tell them.
    • Economy is strong.
    • Clinton has some major accomplishments, like gun reform, and the assault weapons ban. Republicans are furious. The bill he put the most time into was Hillarycare, which unfortunately failed.
    • Republicans focus on macroeconomic goals, which most people do not understand, and put all of their effort towards false claims about how their macroeconomic goals will save the economy.
    • Republicans win

I could go on with previous elections, but the point is clear. Politicians have a responsibility to significantly impact the narrative. If you say you will do something big in the campaign, and then you can, but you don’t, voters will remember in the midterms. That’s an important piece of what happened in 1994. Clinton had an opportunity to control the narrative, but by failing to pass his health care initiative, he had lost his major policy initiative. He did other good things during those two years, including gun control, which has saved lives, but people want good health care because it impacts our lives so regularly, it’s a promise people remember.

For the Biden administration there are lessons to be learned here. Whether or not anything else gets through congress this session, there are still things Biden can do to impact peoples lives before the midterms. The infrastructure bill will not start having an impact on peoples lives probably until the Biden administration is in the history books. It will not help much with the midterms. Biden needs policies which will impact voters in the next 11 months. He needs those policies to hit demographics where turnout is not guaranteed, and help them enough that when he says “Go deliver me another trifecta” (telling, not asking) that voters will realize that they should follow his strong recommendation. They need to be personally invested in the outcome of the 2022 election and understand how it impacts their lives.

There are two policies Biden can do right now which will both fulfill campaign promises Joe Biden made, increase turnout and enthusiasm among key stakeholders in the administration, and also improve our economy. Those two policies are:

  • Forgive all student loans up to $50,000
  • Pardon all federal marijuana offenses.

The last time we saw such bold policies which impacted voters at such extreme levels before the upcoming midterms was before the 1966 election. That allowed more social and economic legislation to be passed which helped millions of Americans.

That is the easy way for Democrats to win the midterms so Biden can be the first democrat to have a trifecta for his entire first term since Jimmy Carter.

How to build Justice

Today’s verdict of Kyle Rittenhouse is a disaster, but not wholly unexpected. There have been many times in history where people have gotten away with murder before, and the reality is that this has been going on for hundreds of years. It is not new, it will happen again.

But we should not be complicit or complacent. This enters in one of the most fundamental questions in political science, which is how does one determine guilt? Every system has its flaws, every system will ultimately depend on people. If you use technology, someone needed to design and implement those algorithms. They had to determine what information that algorithm is fed, and ultimately, this is a human decision, no matter how much technology we might use to determine truth. Technology can certainly help in forensics, but people choose whether to use it, and what data to build it off of.

Every country in the world has a court system. Every community of people in the world will determine a method of enforcing rules and norms, and how to enforce those rules and norms, whether it be the government of China, or a commune of 10-20 people. The scale may be different, the fundamental principles of political science, sociology, and psychology however will stay the same.

Every legal system in the world will have three sides, one part determines what rules are going to be established, one will enforce the law, and the third will determine how the system is enforced. In the United States we call these the Congress who makes the rules, the President who enforces the rules through all of the Federal agencies, and the court system enforces the rules. In some countries the executive branch is elected by the people (aka a Presidential system), in some they are directly appointed by the legislative system (aka a Parliamentary system). Both of these systems have advantages and disadvantages. Neither is inherently better than the other.

Courts have two main extreme forms, with any form of authority, be it a commune, or the United States government. One extreme is where an appointed or elected judge determines the fate of the accused, besides those judges, no one else has any say. The other extreme is where the decision is fully come to by a jury of average citizens, and the jury changes for every trial. The United States has a system where the jury makes the final decision, but the judge enforces speaking time and the rules for the trial. The judge is supposed to have limited influence on the jury in our system, though of course the judge does have influence because of their decision on how often parties are allowed to speak.

So which is better? The argument for the jury system because it is still arguably better than a politically appointed judge making the final call. The best argument for a judge making the call (assuming the judge is properly elected) is that the entire population has a say on what type of judge you have determining your fate. Its impossible to know whether a politically appointed judge or elected judge would have come to a different decision.

What it ultimately comes down to is what are the values, educations, and norms of the population the system is serving.

In a world where everyone was compassionate, educated, and clear headed, either system would work fine. In a world where laws were enforced equitably and fairly, either system would work.

But the issue in society is that corruption is a constant temptation for those who have access to power. The temptation to take a public office and turn it into personal wealth is something which is hard to eliminate fully. Better angels in positions of power certainly make a difference, but when you are in a legislative body, you can quickly gain connections which can turn into very real job opportunities. While former members of congress get a salary for the rest of their lives, and it is a high salary, it pales in comparison to the money which can be made from the connections one makes from being in a position of power. If just being able to post a video on YouTube, or sharing a blog post which has ads, power attracts views, views generate cash. Unless if people were to suddenly stop listening to former officials, especially powerful former officials, which is absolutely never going to happen because of human nature, the potential for making money after serving in high public office is always going to exist.

Corruption however is converting public wealth into private wealth. It is the looting of the masses, to turn laws which serve the public into laws which harm the public as they benefit the final decision maker. Prominent examples include Gramm-Leach-Bliley, the Fugitive Slave Act, and many more.

But what we saw today with the decision regarding Kyle Rittenhouse was deeper. I don’t know what went through the minds of the jury to bring them to such an obviously wrong decision. The claim of self-defense is so obviously wrong. Someone doesn’t walk into a protest with a machine gun and shoot people who weren’t even attacking him in self-defense.

It’s very obvious when you look at the evidence that the protesters saw someone who did not agree with them running into the crowd, only looking to cause trouble. It is very obvious that Rittenhouse’s defense was lying all the way through.

He walked into a protest for police violence with a gun. He meant to cause harm. Protesters noticed his presence and acted in self-defense. If you are in a public event, and you see someone brandishing a gun, you have good reason to assume that they are up to no good. You have reason to defend yourself. Rittenhouse might have won the trial… but he knows that he was guilty.

It is even more clear that what really happened is that as people were protesting police brutality, Rittenhouse supported the murder which the police had done earlier, and it comes back to a reality that for hundreds of years in the United States people who defend Black Lives are not, and have never been, protected by the law.

It’s just a matter of time before more lone wolf Nazi terrorists go to protests regularly and shoot unarmed civilians again. This is likely to become normal, and the police will not protect the first amendment. The President refuses to criticize the decision of jurors all while giving progressives a hell of a time for standing up for his agenda. Voting rights are being lost, and there is a very high probability we will lose congress next year.

So what are our options?

  1. Violent revolution
  2. Vote in large numbers
  3. Protest in large numbers

Violent revolutions have a low success rate. Most violent revolutions end up with a system which is just as bad if not worse than the one which came before it. No democracy in the world was truly born from revolution, not even the United States. Building stable institutions takes time, so this is probably going to make the situation worse.

Vote in large numbers. Assuming that democracy is the least bad political system if you care about things like human rights, overall well being, and controlling equality, history tends to support that viewpoint, we are going to have a Democratic system. Democratic systems are only as good as the people you elect, and those people are only as good as the citizenry and how often those people vote. It’s time to take a deep long look at our political systems as political scientists do, and ensure that we have good people at the helm. It’s time to look at the research of social change from sociology where people have studied these very topics and have already identified solutions to the problems which plague us. When we elect leaders who say they will do something, we need to hold them accountable. We need to reform our election systems so we have more choice in the election, and make primaries meaningless. This process has already started.

Protesting in large numbers shows support for a cause. Generally they are calling for political change. Protesting + good government = change.

We need to change the systemic features of American society which uphold white supremacy these include:

  • The difference in wealth held by white and black families.
  • The difference in opportunities in majority white and majority black schools.
  • Gerrymandering which upholds racism
  • The Electoral College needs to be abolished
  • Police receive vast sums of money while social services are starved
  • Qualified Immunity allows police to get away with murder

And of course many more problems.

There are countless articles from countless organizations which go in detail on each of these points, and other points which I know I have missed. We need to ensure that our institutions support freedom and justice, and ensure that the people in those institutions are good people. No matter what society you are looking at, at any level, it always comes down to that. You need robust rules on how decisions are made which are strong, but ultimately we need to ensure that the stewards of our society who maintain our institutions are good people, out to do what is best for America. We have failed to do that as a country. That is why Rittenhouse is free. That is what needs to change.

References:

https://www.usatoday.com/story/news/nation/2020/08/28/kyle-rittenhouse-shooting-kenosha-what-we-know-victims/5654579002/

https://www.thedailybeast.com/aerial-fbi-video-shows-kyle-rittenhouse-wielding-assault-rifle-moments-before-fatally-shooting-two-people

Setting with Copy Warning

One of the most frustrating issues in Pandas is the SettingWithCopyWarning. To a beginner in Pandas this can be one of the most frustrating issues to deal with. What becomes even more frustrating is that the documentation is not very helpful, and StackOverflow offers a ton of answers which don’t help either.

The answer is actually quite simple. Pandas Dataframes are similar to dictionaries in how they have indexes, and every row has a specific name. This is useful because it helps ensure that every item will be placed in the proper row.

To make this work without triggering the error, you need to make sure that when you are retaining the row index in the object you are creating with your desired values.

Here are two common situations which you might find:

Rename a specific column

A Pandas noob will be inclined to write the following:


price_lb=prices[prices['Data Item'].str.contains('LB')]
price_lb['Value per pound'] = price_lb['Value']

Which will return the following error:

:2: SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
price_lb[‘Value per pound’] = price_lb[‘Value’]

How do we solve this?!?!

Well, we need our good friend pd.concat to solve this problem unambiguously:


temp_df = pd.DataFrame(price_lb['Value'])
temp_df.columns = ['Value per pound']
price_lb=pd.concat([price_lb,temp_df], axis=1)

This is what you should do in order to ensure that there is no potential mismatching of data. We know this works because temp_df.index is identical to price_lb.index.

Run an operation on a column

A Pandas noob will be inclined to write the following:

price_ton['Value']=[x.replace(',','').replace(' (S)','').replace(" (NA)",'') for x in price_ton['Value']]

This presents a problem, because this generates a list, which has a index which is from 0 to the length of the list. This most likely doesn’t match the index of the DataFrame!

So we need to run an operation on this column, but also retain the index. Lambda functions are your friend in this situation. Rewrite your function like so:


values=price_ton['Value'].apply(lambda x: x.replace(',','').replace(' (S)','').replace(" (NA)",''))

Values will now retain the index and column name of the original Dataframe!

You can then use a pd.concat() function to bring this information back into your original dataframe.


price_ton=pd.concat([price_ton,pd.DataFrame(price_ton['Value'].apply(lambda x: x.replace(',','').replace(' (S)','').replace(" (NA)",'')))], axis=1)

No warnings, and every datapoint is exactly where it belongs.

I hope this helps you write better Python code.

How I protect my accounts

I have several layers of protection on my most important accounts. In short, I use the following secure features:

  • Each account has a unique random password which is generated and stored in my Lastpass Vault
  • Lastpass requires Email authentication to login to a new device
  • The email I use for Lastpass has two factor authentication with my personal phone

So in order to steal my data you would need to:

  1. Randomly guess the password for my email account. If you make too many wrong attempts, any half decent website will lock your account for a few minutes. This means repetitively entering in passwords will not work. If my password is 10 digits long, where any character can be one of 96 possible characters on a US English keyboards, you are looking 6.65e19 possible combinations (66.5 quintillion in American English). If the website allows 3 wrong passwords in a 5 minute period, it would take over 2.1e14 years to guess every possible password on that one website. It doesn’t just lock out from that one device, it blocks ALL attempts from all clients for those 5 minutes. Random guessing and checking is simply not going to work.
  2. Randomly guess the password for my Lastpass account. Same math. This is not going to work.
  3. In the highly unlikely event where you randomly guessed my Lastpass password, and also my email password, you also need to have my personal phone on your person in order to access my account.

Don’t even try. It’s not worth your time.