Python advanced data processing and visualization (i)

Source: Internet
Author: User

1. Cluster analysis

Clustering (cluster analysis): Based on similarity, similar objects are divided into groups or more subsets by static classification methods. Characteristics: Based on similarity, there are multiple clusters of centers.

The k-means:"k-mean algorithm represents clustering at the center of K points in space, classifying objects closest to them.

    

In [47]: fromNumPyImportVstackin [48]: fromScipy.cluster.vqImportKmeans,vqin [Further]: List1 = [88.0,74.0,96.0,85.0]in []: List2 = [92.0,99.0,95.0,94.0]in [Wuyi]: list3 = [91.0,87.0,99.0,95.0]in ["List4" = [78.0,99.0,97.0,81.0]in [+]: list5 = [88.0,78.0,98.0,84.0]in [SI]: list6 = [100.0,95.0,100.0,92.0]in [: Data = Vstack ((LIST1,LIST2,LIST3,LIST4,LIST5,LIST6))#Stack Arrays in sequence vertically (row wise). Take a sequence of arrays and the stack them vertically to make a single array. In ["Centroids,_" = Kmeans (data,2)#performs K-means on a set of observation vectors forming K clusters.In [+]: result,_ = VQ (data,centroids)#Assign codes from a code book to observations.In [63]: resultout[+]: Array ([1, 0, 0, 0, 1, 0])
cluster analysis based on results

  numpy.vstack: https://docs.scipy.org/doc/numpy/reference/generated/numpy.vstack.html

  Scipy.cluster.vq.kmeans: https://docs.scipy.org/doc/scipy/reference/generated/ Scipy.cluster.vq.kmeans.html#scipy.cluster.vq.kmeans

  scipy.cluster.vq.vq: https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.vq.vq.html

2. Matplotlib Drawing Basics

3. Matplotlib Image Attribute Control

4. Pandas drawing

5. Data access

6. Python's Engineering applications

7. Python's humanities and social sciences applications

Python advanced data processing and visualization (i)

Related Article

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.