Python Data analysis and visualization

Source: Internet
Author: User

Introduction URL: Https://www.kaggle.com/benhamner/d/uciml/iris/python-data-visualizations/notebook

Import Matplotlib.pyplot as Plt

Import Seaborn as SNS

Import Pandas as PD

Import data:

Iris=pd.read_csv (' E:\\data\\iris.csv ')

Iris.head ()


To make a histogram:

Plt.hist (iris[' SEPALLENGTHCM '],bins=15)

Plt.xlabel (' SEPALLENGTHCM ')

Plt.ylabel (' quantity ')

Plt.title (' Distribution of SEPALLENGTHCM ')

Plt.show ()



To make a scatter plot:


But such a diagram does not indicate the color of the different kinds of words = flowers. So we use another way to sort by species.

Violin chart

Box-type diagram:

Ax=sns.boxplot (x= "species", y= "SEPALWIDTHCM", Data=iris)


The use of jitter=true here makes a little bit less of the vertical line in the middle.

Ax=sns.boxplot (x= "species", y= "SEPALWIDTHCM", Data=iris)

Ax=sns.stripplot (x= "species", y= "SEPALWIDTHCM", data=iris,jitter=true,edgecolor= "gray")



Kdeplot: The linkage between univariate variables and the potential characteristics of the variables assessed by a kernel density



Displays the links between the two variables:



Diag_kind= ' KDE ' shows the kernel density between the two variables and uses it to estimate its characteristics



Boxplot_1: Separate features between variables by species



Andrews curves: Andrew Curve uses the properties of the sample as coefficients of the Fourier transform



Radviz: Multivariate visualization, where each feature is displayed on a plane, and the sample is connected to the image by the dots on the circle


Parallel_coordinates multi-variable visualization with parallel coordinates: For each feature of a data sample, we set the feature on the axis and draw a line.

Python Data analysis and visualization

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.