In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about the common modules of Python data analysis. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Preface
Python is an excellent programming language, but python has become a data analysis software because of python's powerful extension module. That is, these python expansion packages enable python to do data analysis, including numpy,scipy,pandas,matplotlib,scikit-learn and many other powerful modules, combined with ipython interactive tools, as well as python's powerful crawler data acquisition and string processing capabilities, making python a complete data analysis tool.
Numpy
Official website: https://www.scipy.org/
NumPy (Numerical Python for short) is the basic package for high-performance scientific computing and data analysis. One of the most important features of NumPy is its N-dimensional array object (ndarray), which is a fast and flexible big data collection container. You can use this array to perform some mathematical operations on the whole block of data, which is more efficient than the arrays and tuples that come with python, and its syntax is the same as the operation between variable elements, without the need for looping operations.
In the process of using python for data analysis, most of the time we do not use the numpy package directly, but other packages use numpy. It can be said that numpy is the cornerstone of the whole python data analysis work.
To take a simple example, we want to calculate the value of 100000 random numbers. If the traditional programming needs to write a loop, it takes 2.2 seconds, and using the numpy data structure, we can do vectorization operation, no loop, only need 28.2ms to save a lot of time.
In [1]: import numpyIn [2]: my_arr = np.arange (1000000) In [3]: my_list = list (range (1000000)) In [4]:% time for _ in range (10): my_arr2 = my_arr * 2Wall time: 28.2msIn [5]:% time for _ in range (10): my_list2 = [x * 2 for x in my_list] Wall time: 2.2s
Pandas
Official website: https://pandas.pydata.org/
Python Data Analysis Library, which can help organize the data of various parameters as needed. Pandas is based on the underlying data structure of numpy. It is mainly the work of pandas that makes python become a statistical software like Excel,R. Pandas realizes all kinds of data calculation, grouping calculation, adding and deleting, sorting, filtering, sampling and so on in python. Make Pandas the most popular library among data scientists.
Pandas mainly contains two kinds of data structures: Series and DataFrame. Series is an object that is similar to an array. It consists of a set of data and associated data labels. Only one set of data can produce the simplest Series. Series is similar to the vector in R and belongs to the data. Series can form a two-dimensional DataFrame. The behavior record value is listed as the observation value. If you are familiar with the data box DataFrame in R, it will be easy to use pandas, because the author himself says that pandas's DataFrame is a data box that mimics R.
Scipy
Official website: https://www.scipy.org/
Scipy is a commonly used software package in the fields of mathematics, science and engineering, which can deal with interpolation, integration, optimization, image processing, numerical solution of ordinary differential equations, signal processing and so on. It is used to effectively calculate the Numpy matrix, make Numpy and Scipy work together and solve problems efficiently.
Matplotlib
Official website: https://matplotlib.org/
Matplotlib is an excellent data visualization package in python. According to its name, it is actually a plot library of matlib, that is, it uses python to realize the drawing function of matlib. If you are familiar with matlib drawing, you will get started. Matplotlib is the visual operation interface of Python programming language and its numerical mathematics expansion package NumPy. It provides an application program interface (API) for embedded drawing in applications using general graphical user interface toolkits such as Tkinter, wxPython, Qt or GTK+.
Plotnine
Official website: https://plotnine.readthedocs.io/en/stable/
If you are not familiar with matlib, but switch from R to python, you may not like the drawing mode and style of matplotlib and find it not as convenient as R drawing. And R has a ggplot2 bag. Then plotnine transplants ggplot2 to python and completely reproduces the function of ggplot2 on python. If you are familiar with the syntax of ggplot2, get started. However, I do not think this work is meaningful, it belongs to the reinvention of the wheel, later if the ggplot2 is updated, there will still be some differences between the two, users will have some trouble. Of course, on such a problem, the benevolent see benevolence, the fool see the fool. It's better than nothing. It's nice to have this package if you want to do all the work in the python environment.
Scikit-learn
Official website: https://scikit-learn.org/stable/
There are a lot of people like big data, machine learning, artificial intelligence every day. Then scikit-learn is the package to complete the machine learning of python big data. Scikit-Learn is a very important module in python data analysis. It is an open source machine learning toolkit based on NumPy and SciPy. It has a commonly used ML algorithm, which can be used for preprocessing, classification, regression and clustering. The algorithms include support vector machine (support vector machines,ridge regression), grid search algorithm (Grid Search algorithm), k-means clustering and so on. There is also a sample data set. API is easy to learn and use. With good performance on almost all platforms, it is popular in both academic and commercial uses.
Thank you for reading! This is the end of this article on "what are the common modules of Python data analysis?" 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, you can share it out 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.