In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use pyecharts to draw a geographical scatter map, I hope you will gain something after reading this article, let's discuss it together!
1. Background
Make use of the Shanghai 7000+ office building project, including the project name, geographical location, daily rent, building area and the business district where the project is located, now let these projects be located on the map according to longitude and latitude, and show the rent by color, there are many things to do before operating ArcGIS software, this time, ready to try the pyecharts module, directly generate with python script.
two。 Effect picture
The effect picture is roughly as follows:
3. Complete Code import pandas as pd # Import data Analysis Module from pyecharts.charts import Geo # Import Geographic Information processing Module from pyecharts import options as opts # configure from pyecharts.render import make_snapshot # Snapshot from snapshot_selenium import snapshot from pyecharts.globals import ChartType SymbolType # Global configuration data=pd.read_excel ("D:\ gravitational\ Modu Business Circle\ office project .xlsx") # read data geo_sight_coord= {data ['project name'] [I] .strip (): [data ['longitude'] [I], data ['latitude'] [I]] for i in range (len (data))} # construct location dictionary data data_pair= [(data ['project name'] [I] .strip ()) Data ['Daily Rent'] [I]) for i in range (len (data)) # Construction Project Rent data g=Geo () # Geographic initialization g.add_schema (maptype= "Shanghai") # limit Shanghai for key, value in geo_sight_coord.items (): # cycle g.add_coordinate (key, value [0], value [1]) # add location g.add (", data_pair") Symbol_size=2) # append project name and rent g.set_series_opts (label_opts=opts.LabelOpts (is_show=False), type='scatter') # scatter plot scatterpieces = [{'max': 3,' label':'
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.