Python It is a good language to realize data visualization , Many of the libraries in them can draw well , The image is clear .

Let's talk about it today :Pandas Data analysis core support library

<> First knowledge Pandas:

Pandas yes Python An extended program library of language , For data analysis .
Pandas Is an open source ,BSD Licensed Libraries , Provide high performance , Easy to use data structure and data analysis tools .

Pandas The name derives from the term “panel data”( Panel data ) and “Python data analysis”(Python Data analysis ).

Pandas A powerful tool set for analyzing structured data , The foundation is Numpy( Provide high performance matrix operation ), The number of times series, One more DataFrame, These three are commonly used .

Pandas From various file formats, such as CSV,JSON,SQL,Microsoft Excel Import data .

Pandas It can operate on all kinds of data , Like merging , Reshaping , choice , There are also data cleaning and data processing features .

Pandas It is widely used in academic research , finance , Statistics and other data analysis fields .

<>Pandas The subject of :

Pandas The main data structure of is Series ( One dimensional data ) And
DataFrame( Two dimensional data ), These two data structures are enough to deal with finance , Statistics , social sciences , Most typical use cases in engineering and other fields .

Series: One dimensional isomorphic arrays with labels , An object similar to one dimensional array , It consists of a set of data ( various Numpy data type ) And a set of related data tags ( Index ) form .
DataFrame: Labeled , Variable size , Two dimensional heterogeneous table
. A tabular data structure , It contains an ordered set of columns , Each column can be a different value type ( numerical value , character string , Boolean value ).DataFrame There are both row and column indexes , It can be seen as made up of
Series A dictionary made up of ( Use a common index ).

<>Pandas Installation of :

Terminal input , If you use it like me Anaconda In Jupyter For the preparation of the representative , It can also be in the Anaconda Input in the terminal of , Then it can be used directly , He is Python A library in , You don't need to install any other software to use it , have Python Compiler .
pip install pandas
<>Pandas Application of :

1: Import pandas library
import pandas as pd
2:pandas of series
Pandas Series Similar to a column in a table (column), It's like a one-dimensional array , You can save any data type Series By index (index) And column composition , The function is as follows :
pandas.Series( data, index, dtype, name, copy)
Parameter description :

data: A set of data (ndarray type ).

index: Data index label , If not specified , Default from 0 start .

dtype: data type , I will judge by myself .

name: Set name .

copy: Copy data , Default to False.

Demo:
FIrst:
import pandas as pd a = ["shimmer", "zhuzhu", "recently Best wishes "] myvar = pd.Series(a
) print(myvar)
Code results :

Second: Modifiable index value ,

Third: Create with dictionary , key/value object , Like a dictionary Series

Fourth: The value can be obtained by specifying the index value

3:pandas of Dataframe
DataFrame
Is a tabular data structure , It contains an ordered set of columns , Each column can be a different value type ( numerical value , character string , Boolean value ).DataFrame There are both row and column indexes , It can be seen as made up of
Series A dictionary made up of ( Use a common index ).

DataFrame The construction method is as follows :
pandas.DataFrame( data, index, columns, dtype, copy)
Parameter description :

data: A set of data (ndarray,series, map, lists, dict And so on ).

index: Index value , Or it can be called row labels .

columns: Column label , Default to RangeIndex (0, 1, 2, …, n) .

dtype: data type .

copy: Copy data , Default to False.

Demo:
First: Specify column labels

Second: Insert columns separately , Created in the form of a dictionary

Third: Using a dictionary (key/value), In which the dictionary key List for :

fourth: adopt loc Value , Like in the list x,index【number】 Value

Fifth: Multiple lines of data can be returned , use [[ … ]] format ,… Index for each row , Separated by commas :

Sixth: Specifies the index value

Seventh: Take the specified index value

That's all for this article , I hope it will be useful to you after reading this article .

Step by step , Wynn !!!
A lot of times I understand a truth , The more we strive for quick success , The more you ask, the less you can , The more anxious you are , More confused .so, down-to-earth , To look up at the starry sky !!!

Technology
©2019-2020 Toolsou All rights reserved,
2020 The 11th National Blue Bridge Cup C/C++b Group summary ( Completion ) Review of the most complete computer network principles in history vue-cli 3 VUE Scaffold project construction ( Detailed explanation ) solve Vue+TypeScript Under development TS Don't recognize this.$refs The question of Vue Using the function of anti chattering and throttling How to use division operation in relational algebra SQL Statement representation ?copy-webpack-plugin Copy and compress files avue The use of dictionaries in English Teaching girls to learn Java: What is? Java?python Code painting Cherry Blossom -python Draw cherry tree code Specific code introduction