In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use numpy,pandas,matplotlib for you. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Using the three libraries in Python, you can gracefully analyze the data and get a wild Matlab, which are numpy,pandas and matplotlib.
Numpy is the basic package of high-performance scientific computing and data analysis. Its array multi-dimensional array has rich data types, which can effectively replace loops based on vectorization technology, and the code is simple and fast.
The data frame dataframe in pandas based on numpy integrates all kinds of data analysis tools, which can carry out complex calculation like array array, manipulate data like excel and manipulate data like SQL.
Matplotlib further realizes the drawing function in matlab style. Its powerful data visualization ability can make your data analysis results attractive.
1. Numpy library
Numpy provides three commonly used objects, array array, matrix matrix, and ufunc (universal function).
1, create array
2. Access the array element
3Query array operation
4, use matrix operation
5, use the ufunc object
2. Pandas library
DataFrame in pandas is the most widely used data structure for interactivity in data analysis.
The data structures commonly used in pandas are:
(1) Series: one-dimensional array, similar to one-dimensional array in Numpy.
Only the same data type can be stored in Series.
(2) DataFrame: two-dimensional tabular data structure.
You can think of DataFrame as a container for Series.
(3) Panel: a three-dimensional array that can be understood as a container for DataFrame.
1refine Series object
2, create a DataFrame object
3. Read the DataFrame object from excel
4, add rows
5, delete rows
6, add columns
7, delete column
8, move the column
9, sort
10, splicing
11, select data
There are three ways to select data: subscript index, label index, and Boolean index.
12, export to csv file or excel file
13, commonly used statistical functions
14, time format
Third, matplotlib library
Matplotlib supports functional drawing and object-oriented drawing.
The functional drawing method is consistent with the matlab style, first drawing the image with a sentence, and then decorating it with a series of functions. The object-oriented drawing method is generally completed from top to bottom, first creating figure, then creating subgraph ax, then drawing data, and finally designing various auxiliary elements (including xaxis, yaxis, title, grid,legend, annotate, etc.).
1, line chart
2, bar chart
3, columnar distribution
4, scatter plot
5, pie chart
6. Draw a subgraph
Common shortcut keys for Appendix:Jupyter Notebook
Tab object completion
Shift + Tab object hint help
Ctrl + Enter runs the current cell
Shift + Enter runs the current cell and selects the next cell
Alt + Enter runs the current cell and creates an empty cell below
Esc * M switches to markdown input state
Esc * An insert cell above
Esc * B insert cell below
This is the end of the article on "how to use numpy,pandas,matplotlib". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.