In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you how to use Python to do epidemic data analysis, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.
Recently, in this extraordinary period of national anti-epidemic, apart from telecommuting at home every day, I can't help but refresh the epidemic information at any time and pay attention to the latest news.
In particular, when I refreshed the daily epidemic map data, I found some rules when I saw the new confirmed cases, suspected cases, mortality, cure rate and other data.
Although there is sometimes no official good news, some optimistic data can be found in the data to ease the depression that I have been unable to go out for a long time.
Today, I will make some analysis of some known epidemic data with the help of Python for your reference.
First of all, let's choose an epidemic map data source. Take Baidu as an example, all the data come from the data published by the national and provincial and municipal health and construction committees.
From the perspective of the overall data, I am optimistic about the situation in the future. after all, the number of diagnoses is slowly declining every day, and the cure rate is rising. I hope that more people can be treated in time.
Analysis of cure rate and fatality rate in different provinces
After getting these data, I want to get two more detailed data, that is, the cure rate and fatality rate of each province.
First import these data into the CSV file to determine the four columns of data (province, number of diagnoses, cure rate, number of deaths).
Now let's start writing code and importing the CSV file.
From the above code, we can see that the read_csv () method of pandas returns a DateFrame object by default.
Now let's analyze the data of DateFrame and calculate the cure rate and fatality rate. The contents of the code are relatively simple and can be understood by people who have no programming foundation as much as possible.
From the above code examples, Ningxia and Gansu have the highest cure rate of 26.42% and 24.42% respectively, which may be the reason why the number of diagnoses is relatively small and the symptoms are relatively mild.
In addition, a large number of people have been diagnosed in Hunan and Zhejiang, the cure rate is relatively high, and the high level of local medical care should also be one of the reasons.
As for Hubei, the cure rate is about 7%, which has a lot to do with the fact that it is the center of the epidemic area, and medical resources are insufficient. I hope the situation will improve with the establishment of Leishenshan of Vulcan and Fangdang Hospital.
Next, let's analyze the fatality rate, just like the cure rate, we only need to add one more column of data.
It is still the highest in Hubei, followed by Hong Kong, Gansu, Hainan, Heilongjiang, or the old cause of high fatality rate in Hubei, which is caused by concentrated outbreaks and runs on medical resources.
Hong Kong and Gansu are estimated to have a higher fatality rate because of the base number.
As for Hainan and Heilongjiang, I personally think there are three reasons for the high proportion.
Response speed, because it is relatively far away from the epidemic area, has a certain impact on the timeliness of the message.
The inflow of population, Hainan is the Spring Festival people often go to the exclusive resort, many people in the epidemic areas may go with their families, leading to a concentrated outbreak.
Medical resources, local medical conditions may not compare with some large cities and coastal developed cities, caused by the lack of medical resources.
Of course, the fatality rate has a lot to do with the specific conditions of the patients. if the patient is already seriously ill or has other complications at the time of admission, then the fatality rate will certainly increase.
It is worth mentioning that the fatality rate in Guangdong, in the case of so many confirmed cases (1177), the fatality rate is 0.08%, it has to be said to be something worthy of encouragement and praise.
The cure rate and fatality rate in the data can only be said to reflect the local infection, response speed, medical conditions and so on. We can analyze the epidemic data from another angle.
In terms of the overall fatality rate, I think the situation is optimistic. The intensity of this epidemic is actually not as violent as that of SARS, just because its long incubation period leads to a particularly wide spread area and number of people, so we need to persist for a longer time to make it disappear.
The proportion of the population moving in
First of all, let's look at the relocation of Wuhan to various cities during the Spring Festival through the migration data of Baidu Map.
Through the scale map of the provinces moving out of Wuhan during the Spring Festival transportation period from January 10 to January 24, 2020, we can see that most of these data are equal to the proportion of diagnosed people.
Zhejiang, Hebei, Shandong and other places have moved in a large number of people, so the number of confirmed cases is also very large.
As for the reason why the migration data of Hunan, Henan and other places with the largest number of confirmed cases are not obvious, my estimate is that Hubei is particularly close to Hunan and Henan. There has been a large number of population movements before January 10, and all localities have not attracted special attention. Coupled with the long incubation period, it broke out immediately.
Chongqing and Sichuan have a large proportion of people moving in, but the reason why the confirmed cases are not so high is that the exact time of prevention and control information coincides with the time of moving in, makes a rapid response, and isolates the people from the epidemic as soon as possible.
Since I am in Chengdu, I will analyze and compare it with the immigration data and diagnosis data of Chengdu.
Chengdu ranked 29th in the inflow of Wuhan citizens, accounting for 0.44%. If calculated according to the outflow of 5 million people, it is more than 22000, with an average inflow of 7800 a day a month.
The number of confirmed cases in Chengdu today is 124. Of these, one of the three cases is externally imported, and the rest are infected by locals, which looks like 80 people. Chengdu is also a big city with a population of 20 million. From the perspective of prevention and control, it has done a very good job.
In addition, the number of confirmed cases in Chengdu today is 124, the number of cured people is 41, and the cure rate has reached 1/3, which has to be said to be an exciting number.
Although the cure rate of patients' own physical quality also has a great relationship, but from another point of view, timely access to information is necessary for prevention and control.
As far as I am concerned, when I got the news that it was necessary to wear a mask, it should be January 19, when I felt that everyone had begun to pay attention to it, and the drugstore could not buy masks anymore, so we should be consciously prepared for prevention and control. the sooner we do the prevention and control of critically ill patients, the fewer the number of critically ill patients will be, and the cure rate will naturally increase.
Summary
Judging from the situation in recent days, the number of new suspected cases and confirmed cases is declining every day, and the number of people cured far exceeds the number of deaths. From the overall trend, the situation is slowly improving.
Today, I only do some simple data analysis with Python's pandas. I will analyze the known data from different angles in detail in the following time, and dig out more details hidden behind the data. I also believe that with the attention and efforts of the whole people, we will eventually persist until the spring blooming season and the sunny day.
I sincerely hope that you will go out less, wash your hands frequently, minimize contact with outsiders, and inform the local CDC in time when you find something abnormal. Although I usually hate traffic jams when I drive, I still prefer the streets to be more congested and lively when there are no traffic jams and the streets are deserted for more than half a month.
The above content is how to use Python to do epidemic data analysis, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.