Use Python to analyze the gender and location of friends and python gender
A very interesting library is used today --ItchatIt has completed wechat's personal account API, making it easier to crawl personal information.
Download
Crawl friend information
In this way, all your friends are returned. We do not need so much information. We choose to store some information to a csv file.
Note: The returned information is a list. The first one is my own information, so it starts from the second item.
Stored files
2: female, 1: male, 0: Others
Next, we will analyze the data in the csv file.
First, let's look at the gender distribution of friends:
I used the Echarts chart here and stole a lazy
I still have a large proportion of male, which is normal.
Next, we will analyze the location of friends.
Echarts display
This bar chart intuitively shows the distribution of friends.
This article only uses a small feature of itchat. It also has many interesting features, such as automatic reply to information, automatic addition of friends, and management groups, all of which are waiting for you to actively explore.
Reprint | Source: http://t.cn/R8Ljkir