Data Visualization-Python

Source: Internet
Author: User
Tags jupyter jupyter notebook

Prerequisites:

Familiarity with cognitive new programming tools (Jupyter Notebook)

1, installation: The use of PIP to install Jupyter. Enter the installation command PIP install Jupyter can be;

2, start: After the installation is complete, we can find Jupyter-notebook This application in the following directory; double-click Start

As shown in the following:

3. Open the browser compiler

The programming tool is ready to complete.

Practical Data Visualization Tutorial:
Import Pymongo Import Charts
 client = Pymongo. Mongoclient ( '  localhost  " , 27017) Ceshi  = Client[ ceshi   "  ]item_info  = Ceshi[ " item_info  Span style= "COLOR: #800000" > ' ] 
 for  i in  item_info.find (). Limit (300< Span style= "color: #000000"):  if  i[  area   ' ] = = [ " ":  pass  else  :  print  (I["  area   ' ]) 
 area_list = []  for  i in  item_info.find (). Limit (300 if  i[ " area   "] = = ["   ]:  pass  else  : Area_list.append (i[ "  area   "][1]) Area_index  = list (set (area_list))  print  (Area_index) 
Post_times = [] for in area_index:    post_times.append (Area_list.count (index))  Print(post_times)    
Data_gen ('column')
defData_gen (types): Length=0ifLength <=Len (area_index): forArea,timesinchZip (area_index,post_times): Data= {                'name': Area,'Data': [Times],'type': Types}yieldData Length+ = 1

 for  in Data_gen ('column'):    print(i)
 for  in Data_gen ('column')]charts.plot (series,show=' ) inline ', Options=dict (title=dict (text=' Hangzhou Post Data statistics- Wang ')))

Final Run Result:

Summarize the points of knowledge:

1, the introduction and use of charts module;

2, the list of append () function use;

3, COUNT () function use;

4, the use of Set function sets ();

5, the use of list analytic type;

6, the use of the zip () function;

7, the use of yield generator;

8, MongoDB database operation use;

Data Visualization-Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.