Python uses seaborn to analyze Shanghai's second-hand housing data

Analysis of second-hand housing data in Shanghai

Students of gcc should not plagiarize!
Experiment time 2023-05-6

1. Experimental equipment or materials

Laptop, Anaconda software

2. Data and demand description

1. Part of the data is as follows:
insert image description here

2. Requirements
To use this data, the following points need to be analyzed:
1. The overall price description of second-hand houses in Shanghai
2. The distribution of unit prices of second-hand houses in Shanghai
3. The distribution of unit prices and total prices in various urban areas in Shanghai
4. Analysis of housing resources in various urban areas in Shanghai
5. The relationship between housing prices in Shanghai and the size of houses
. 6. Correlation analysis of various dimensions of second-hand housing in Shanghai.

3. Experimental content and analysis
0. Read the file and explore and analyze the data
insert image description here
insert image description here
insert image description here
insert image description here

1. Description of the overall price of second-hand housing in Shanghai

insert image description here

Analysis: The average price of second-hand housing prices in Shanghai is 5.8 million. It can be seen that the housing prices are so high. There are two main reasons for the high housing prices in Shanghai. The first is that Shanghai has a developed economy and overall prices are relatively high. The second is that the land area in Shanghai is small, and the supply of commercial housing is in short supply.

2. Distribution of unit prices of second-hand houses in Shanghai

insert image description hereinsert image description here

Analysis:
1. The overall unit price of second-hand housing in Shanghai is relatively low, and about 80% of the housing units are priced below 100,000 yuan per square meter.
2. The fact that the unit price is concentrated below 50,000 yuan/square meter shows that Shanghai citizens do not have a high tolerance for housing prices, so there is a lot of demand for affordable housing.
3.10 Unit prices in the two ranges of 150,000 yuan/square meter and 150,000 to 200,000 yuan/square meter are also relatively common, indicating that there are still a certain number of high-end apartments, villas and other housing sources.

3. Distribution of unit price and total price in various urban areas of Shanghai

insert image description here
insert image description here

From the figure, we can see that in Pudong area, the unit price and total price of houses are mostly concentrated between 100,000-200,000. However, the unit price of a house also has a lot to do with the size of the house. The unit price of a small-sized house is often very high, which is more expensive than a large-sized house. In other areas, the average unit price is relatively concentrated, while the average total price is somewhat different, which is related to factors such as location, traffic, and housing area.

4. Analysis of housing resources in various urban areas of Shanghai

insert image description here
insert image description here

Xuhui, Minhang and Pudong are the three districts with the largest number of houses. Various factors in these three districts, such as geographical location and school district, are considered to be one of the relatively high-quality residential areas in Shanghai, so this may also lead to these The number of listings in the area is relatively high.
In urban areas such as Chongming and Jinshan, however, there are fewer houses. Most of these areas are far away from the city center, and there are also reasons such as the lack of real estate developed by developers.
Urban areas such as Longhua, Changning, and Putuo all have a relatively high number of houses. It is necessary to comprehensively analyze their geographical distance, infrastructure, and industries to further understand the reasons for the distribution of each urban area.
The number of houses does not necessarily directly determine the housing prices in the area. The price depends on multiple factors, such as area, unit type, floor, orientation, building age, and community environment. Therefore, a comprehensive consideration of the various factors above is required to better understand the real estate market and based on launch forecasts and decisions.

5. The relationship between house prices and the size of houses in Shanghai

insert image description here
insert image description here

There is a certain positive correlation between house price and area. The larger the housing area, the average unit price will gradually decrease.
From the perspective of construction time, the price of properties built in the early stage may be higher. However, this rule may not hold true in all cases. For example, some old houses may cause prices to skyrocket due to the influence of factors such as region and location.
From the perspective of area, floor and orientation, different attributes will also have an impact on housing prices. Centrally located, south-facing and lower floors are generally more popular and more expensive.

6. Correlation analysis of various dimensions of second-hand housing in Shanghai.

insert image description here
insert image description here

1. There is a positive correlation between the housing area and housing prices, that is, the larger the area, the higher the housing prices.
2. There is no obvious positive or negative correlation between districts and housing prices, and the housing prices in different regions vary greatly.
3. There is also a certain correlation between the floor and the housing price. In most cases, the higher the floor, the lower the housing price.
4. There is no obvious correlation between orientation and housing prices, but houses facing south are more popular, and the price is slightly higher than other orientations. 5.
There is also a certain correlation between construction time and housing prices. Basically, the earlier the construction period, the higher the housing prices. Low.

4. Conclusion and experience

  1. First, you need to store the house sales data into a DataFrame, you can use the read_csv function of pandas to read the csv file, or use the read_excel function to read the Excel file.
  2. Then, the basic statistics of each column in the DataFrame can be obtained through the describe function, including count, mean, standard deviation, minimum, 25%!, 75%! and (MISSING) maximum.
  3. You can further use the groupby function to group the data according to a certain column, and then use the agg function to calculate the statistics of each group of data, such as the average house price and sales volume of each city.
  4. Of course, the plot function can also be used to perform visual analysis on the data, such as drawing histograms, histograms, scatter plots, etc.
  5. Finally, it is necessary to conduct in-depth analysis and mining of data in combination with actual business scenarios, such as analyzing the reasons for the sales situation in a certain city, or predicting future sales trends, etc.
    Personal experience: Using the pandas library can quickly and easily carry out data statistics and analysis, especially when dealing with large and complex data, it can greatly improve work efficiency. At the same time, proficiency in the common functions and methods of pandas can provide powerful tool support for data scientists and business analysts, bringing a lot of convenience and help to their work.

Guess you like

Origin blog.csdn.net/weixin_48676558/article/details/130522754