origin

I don’t know when it started, the majority of program monkeys (not including program girls) are always ridiculed, has always been the group of singles by strength. According to the Internet, the number of single people in China is as high as 200 million. My God, not all of those 200 million are programmers

The breakthrough point

And my starting point is demographic data, by looking at the demographics, the ratio of men to women, to see if it’s up to you to be single.

First of all, thank you for the data of “Kuaiyi Financial network”

www.kuaiyilicai.com/

The data I use here are all from this website, and there are all kinds of financial data on the website, you can go and have a look.

To obtain the proportion of women in China

First of all, let’s grab the annual proportion of China’s female data, to see how easy it is to find an object in what era

import requests
from bs4 import BeautifulSoup

url = 'https://www.kuaiyilicai.com/stats/global/yearly_per_country/g_population_female_perc/chn.html'
res = requests.get(url).text
html = BeautifulSoup(res, 'html.parser')
html.find('tbody').find_all('td')
Copy the code

In this way, we get all the table data

[< td > < / td > 2018, 48.68% < / td > < td >, < td > < / td > 2017, 48.67% < / td > < td >, < td > < / td > 2016, 48.65% < / td > < td >, < td > < / td >, 2015, < td > 48.64% < / td >, < td > < / td >, 2014, < td > < / td > 48.63%,...Copy the code

However, there will be a code for Google ads in the table data, which needs to be removed

chinese_data = html.find('tbody').find_all('td')
i = 0
for d in chinese_data:
    if r"adsbygoogle" in d.text:
        chinese_data.pop(i)
    i += 1
Copy the code

Now you can get the year and the corresponding data

year = []
data = []
i = 1
for d in chinese_data:
    ifi == 1 or i%2 ! = 0: year.append(d.text)else:
        temp = d.text.split(The '%')
        data.append(temp[0])
    i += 1
Copy the code

With the year and data lists in hand, we can start plotting.

Of course, I also got the proportion of women in other countries in the world, the proportion of births, and so on, in a similar way, so I won’t repeat them all.

Mapping analysis

Analysis of the proportion of women in past years

It can also be seen that in the early days after the founding of new China, the proportion of women was the lowest, and then increased year by year. Logically speaking, after decades of wars such as warlords and the War of Resistance against Japanese Aggression, the ratio of men to women should be balanced, but unexpectedly the imbalance is so serious.

However, the situation is gradually getting better. In the 1980s, the proportion of women in China has been stable at 48.69%-48.68%, and 48.69% has already been the highest proportion of women.

It is not clear, then, that the proportion of women fell sharply in the first decade of the new millennium, only to increase again every year, and that young boys in elementary and middle school are feeling a little less available to the opposite sex.

I have a bar chart here, and you can also see that in the decade of 60 and 70, the proportion of women increased significantly

cherish

Annual birth ratio analysis

The sex ratio at birth is the ratio of male births to female births. Under normal circumstances, the sex ratio at birth is determined by biological laws and remains between 1.02 and 1.07. That is to say, it is generally accepted by statisticians and biologists that males are more likely to be born than females.

Let’s take a look at the trend of sex at birth in China over the years

The specific reason is no longer in-depth, I do not know, I dare not say ah.

Let’s take one year and look at the difference in the number of boys and girls born in that year

In 2007, for example, the sex ratio at birth was 1.17. We can’t get the total number of births that year, but we can get the current birth rate and the total population, so we can do some calculations.

I did some elementary school math and found that there were 1,672,560 more boys than girls born in 2007, more than a million more boys, and that’s just one year. Over the years, a gap of more than 30 million is normal.

So much for the domestic bitterness, let’s take a look at the worldwide data, happiness or pain, and compare them to tell the truth

Women in every country in the world

I’ve pulled together the top 10 women in the world to see which countries have the happiest men

But a few years ago, the process of the network on the domestic diaos guy, to Ukraine through personal struggle, successfully married baifumei, on the life of the story has been inspiring me (we).

At number one on the list, Curacao, which is a place I’ve never heard of. The baidu

Now, let’s take a look at the top 10 countries for women

Worldwide sex ratio at birth

Finally, let’s look at the worldwide sex ratio at birth

The top ten with the highest percentage

So, to sum up, as programmers, we successfully get rid of single, it is a successful reflection of personal strength and personality charm, if still single, ok friends, the environment is not good

Well, that’s the end of today’s sharing. How about finding out why you’re single? Have you caught up with the best of times?