- Python:Data Analytics and Visualization
- Phuong Vo.T.H Martin Czygan Ashish Kumar Kirthi Raman
- 317字
- 2021-07-09 18:51:38
Summary
In this chapter, we covered a lot of information related to the NumPy package, especially commonly used functions that are very helpful to process and analyze data in ndarray
. Firstly, we learned the properties and data type of ndarray
in the NumPy package. Secondly, we focused on how to create and manipulate an ndarray
in different ways, such as conversion from other structures, reading an array from disk, or just generating a new array with given values. Thirdly, we studied how to access and control the value of each element in ndarray
by using indexing and slicing.
Then, we are getting familiar with some common functions and operations on ndarray
.
And finally, we continue with some advance functions that are related to statistic, linear algebra and sampling data. Those functions play important role in data analysis.
However, while NumPy by itself does not provide very much high-level data analytical functionality, having an understanding of it will help you use tools such as Pandas much more effectively. This tool will be discussed in the next chapter.
Practice exercises
Exercise 1: Using an array creation function, let's try to create arrays variable in the following situations:
- Create
ndarray
from the existing data - Initialize
ndarray
which elements are filled with ones, zeros, or a given interval - Loading and saving data from a file to an
ndarray
Exercise 2: What is the difference between np.dot(a, b)
and (a*b)
?
Exercise 3: Consider the vector [1, 2, 3, 4, 5] building a new vector with four consecutive zeros interleaved between each value.
Exercise 4: Taking the data example file chapter2-data.txt
, which includes information on a system log, solves the following tasks:
- Try to build an
ndarray
from the data file - Statistic frequency of each device type in the built matrix
- List unique OS that appears in the data log
- Sort user by
provinceID
and count the number of users in each province
- Splunk 7 Essentials(Third Edition)
- Word 2000、Excel 2000、PowerPoint 2000上機指導與練習
- 高性能混合信號ARM:ADuC7xxx原理與應用開發
- 工業機器人入門實用教程(KUKA機器人)
- 深度學習中的圖像分類與對抗技術
- 大數據平臺異常檢測分析系統的若干關鍵技術研究
- C語言開發技術詳解
- Embedded Programming with Modern C++ Cookbook
- 網絡化分布式系統預測控制
- Kubernetes for Serverless Applications
- Extending Ansible
- 單片機技術項目化原理與實訓
- PowerMill 2020五軸數控加工編程應用實例
- 基于RPA技術財務機器人的應用與研究
- 3ds Max造型表現藝術