Visualizing the location of houses based on latitude and longitude

We have the latitude and longitude for each house in the dataset. Let's look at the most common locations and how the houses are placed:

plt.figure(figsize=(20,14)) 
sns.jointplot(x=data.lat.values, y=data.long.values, size=10)
plt.ylabel('Longitude', fontsize=12)
plt.xlabel('Latitude', fontsize=12)
plt.show()
sns.despine

The output of the preceding snippet should look like the following screenshot:

Figure 6.3: Visualizing the dataset based on location

Seaborn is an amazing Python library for building a multitude of charts and visualizing our data. In this case, we use the same library to plot a chart based on location. We used the jointplot function from the library to see the concentration of the data. You can learn more about this function from the documentation site. Figure 6.3 shows that there are more houses between latitudes 47.7 and 47.8 and the concentration of the houses is higher between longitudes -122.2 to -122.4. The concentration of the houses could indicate several conclusions, such as people like to buy houses in these areas.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset