The mapping function pandas --- Seaborn / seaborn.load_dataset / matplotlib.pyplot / matplotlib.pyplot.plot

1.Seaborn

Seaborn matplotlib Python data based visualization library. It provides a high-level interface for graphics rendering statistics fascinating and informative. Learn more use Seaborn official introduction

2.seaborn.load_dataset

seaborn.load_dataset (name, cache = True, data_home = None, ** kws) data set acquired from an online database (internet connection required).
Parameters:
name: the name string, the data set ( name .csv ON https://github.com/mwaskom/seaborn-data). You can obtain the available data sets get_dataset_names ()
Cache: boolean, optional, If True, and used in subsequent calls to cache the data in the local cache
data_home: string, optional directory used to store cached data. Using default ~ / Seaborn-Data /
KWS: dict, optionally, passed to pandas.read_csv
this regard, refer to the official web more

Here Insert Picture Description

3.matplotlib.pyplot

matplotlib.pyplot.acorr (x, hold = None, data = None, ** kwargs)
Parameter Description

x Scalar sequence
hold Boolean, optional, not recommended, default value: True
detrend Callable, optional, default: mlab.detrend_none
normed Boolean, optional, default value: True If True, vector normalized to unit length will be entered.
usevlines Boolean, optional, default: True if True, the perpendicular line is drawn using Axes.vlines from the origin to the acorr. Otherwise, the Axes.plot
maxlags Integer, optional, default: 10; lag times displayed. If None, returns all 2 * len (x) -1 lags.
return value (Hysteresis, c, row, b): wherein: lags length is 2 maxlags + 1滞后向量。c 是2maxlags + autocorrelation vector. 1 is returned by line Line2D examples plot, b is the x-axis.
More Click here to enter the official website for more examples
4.matplotlib.pyplot.plot

matplotlib.pyplot.acorr(x,hold = None,data = None,** kwargs )

Detailed parameters:
network search an article written by feel quite helpful, do not write it yourself:
1. Refer blog matplotlib.pyplot.plot () Parameter Description
2. Refer to the official website: matplotlib.pyplot is an interface based on the state of the matplotlib

5. Examples of use:

(5.1) Series exemplary graph of FIG row line ------

now = pd.datetime.now()
index = pd.date_range(start=now,periods=6,freq='Q')
s = Series(data=np.random.randint(77,99,size=6),index= index,name='W')
s.plot(kind='line')

Here Insert Picture Description
Here Insert Picture Description
(5.1) DataFrame row line ------ exemplary graph of FIG.

now = pd.datetime.now()
index1 = pd.date_range(start=now,periods=6,freq='Q')
data1 = {
    'product':np.random.randint(25,45,size=6),
    'number_pen':np.random.randint(3,5,size=6)
       }
df = DataFrame(data=data1,index=index1)
df.plot(kind='line')

Here Insert Picture Description
(5.2) Series histogram chart exemplary ------

s = Series(data=np.random.randint(24,79,size=3),index=list('ABC'))
s.plot(kind='bar/barh')

Here Insert Picture Description
(5.2) DataFrame histogram chart exemplary ------

df = DataFrame(data=np.random.randint(3,9,size=(3,7)),columns=list('ABCDEFG'))
df.plot(kind='bar/barh')

Here Insert Picture Description
(5.3) ------ exemplary histogram
statistics for each data interval, the number of data presented
normed: Conversions to the probability (0-1) may occur interval
Density: seabon matplotlib
data.plot (kind = ' hist ', bins = 5, normed = True)
kernel density estimation map, the interval data probability for each possible statistical
data.plot (kind =' kde ')

Show the difference between the number of:

# 个数
data1 = Series(data=np.random.randn(827))
data1.plot(kind='hist')
data1.plot(kind='hist',bins=15)

Here Insert Picture Description
normal of True and False

# normal
data1 = Series(data=np.random.randn(827))
data1.plot(kind='hist',bins=4,normed=False)
data1.plot(kind='hist',bins=4,normed=True)

Here Insert Picture Description
kde use

data1 = Series(data=np.random.randn(827))

data1.plot(kind='hist',bins=6,normed=True)
data1.plot(kind='kde')

data1.plot(kind='hist',bins=2,normed=True)
data1.plot(kind='kde')

Here Insert Picture Description
rondom percentage histogram generates a random number, calling method hist

  • Column height represents the number of audio data, column width represents a group of the sets of data from the
  • The upper limit number of parameters can be set histogram bins square columns, the smaller the larger column width, the finer the data packet
  • Normed parameter set to True, the frequency can be converted into probability
    kde Figure: kernel density estimation, to compensate for the accuracy of the histogram bins set parameters due to the unreasonable due to lack of problems

Two exercises, click here

(5.4) ------ example scatter plot
Here Insert Picture Description
Here Insert Picture Description
if it can not be converted, using a planting method:
Here Insert Picture Description
Reference links: PANDAS category data type
Here Insert Picture Description
references: from learning materials and all linked sites.

Published 73 original articles · won praise 24 · views 2565

Guess you like

Origin blog.csdn.net/weixin_44943394/article/details/103962966