机器学习课程-温州大学-numpy使用总结
机器学习-NumPy使用总结 黄海广 副教授 2 本章目录 01 NumPy概述 02 NumPy数组(ndarry)对象 03 ufunc函数 04 NumPy的函数库 3 1.NumPy概述 01 NumPy概述 02 NumPy数组(ndarry)对象 03 ufunc函数 04 NumPy的函数库 4 NumPy(Numeric 随机数产生 ······ NumPy是什么? 5 NumPy提供了许多高级的数值编程工具,如:矩阵数据类型、矢量处 理,以及精密的运算库。专为进行严格的数字处理而产生。多为很多大 型金融公司使用,以及核心的科学计算组织如:Lawrence Livermore, NASA 用其处理一些本来使用 C++,Fortran 或 Matlab 等所做的任务。 NumPy是什么? 6 标准的P 和内存。 NumPy诞生为了弥补这些缺陷。它提供了两种基本的对象: ndarray:全称(n-dimensional array object)是储存单一数据类型的 多维数组。 ufunc:全称(universal function object)它是一种能够对数组进行处 理的函数。 NumPy的官方文档: https://docs.scipy.org/doc/numpy/reference/0 码力 | 49 页 | 1.52 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.0.0
Using the Numba engine can yield significant performance gains if the apply function can operate on numpy arrays and the data set is larger (1 million rows or greater). For more details, see rolling apply extension type dedicated to string data. Previously, strings were typically stored in object-dtype NumPy arrays. (GH29975) Warning: StringDtype is currently considered experimental. The implementation and may change without warning. The 'string' extension type solves several issues with object-dtype NumPy arrays: 1. You can accidentally store a mixture of strings and non-strings in an object dtype array0 码力 | 3015 页 | 10.78 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.25.1
the output for non-empty columns. Now the ‘top’ and ‘freq’ columns will always be included, with numpy.nan in the case of an empty DataFrame (GH26397) In [39]: df = pd.DataFrame({"empty_col": pd.Categorical([])}) Length: 2, dtype: object 1.2.12 Binary ufuncs on Series now align Applying a binary ufunc like numpy.power() now aligns the inputs when both are Series (GH23293). In [54]: s1 = pd.Series([1, 2, 3], Categorical.argsort() now places missing values at the end of the array, making it consistent with NumPy and the rest of pandas (GH21801). In [60]: cat = pd.Categorical(['b', None, 'a'], categories=['a'0 码力 | 2833 页 | 9.65 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.25.0
the output for non-empty columns. Now the ‘top’ and ‘freq’ columns will always be included, with numpy.nan in the case of an empty DataFrame (GH26397) In [39]: df = pd.DataFrame({"empty_col": pd.Categorical([])}) Length: 2, dtype: object 1.2.12 Binary ufuncs on Series now align Applying a binary ufunc like numpy.power() now aligns the inputs when both are Series (GH23293). In [54]: s1 = pd.Series([1, 2, 3], Categorical.argsort() now places missing values at the end of the array, making it consistent with NumPy and the rest of pandas (GH21801). In [60]: cat = pd.Categorical(['b', None, 'a'], categories=['a'0 码力 | 2827 页 | 9.62 MB | 1 年前3pandas: powerful Python data analysis toolkit - 0.24.0
\\\\\\\\\\Out[20]: ˓→139878052163872 If you need an actual NumPy array, use Series.to_numpy() or Index.to_numpy(). In [21]: idx.to_numpy() Out[21]: array([Period('2000-01-01', 'D'), Period('2000-01-02' Period('2000-01-03', 'D'), Period('2000-01-04', 'D')], dtype=object) In [22]: pd.Series(idx).to_numpy() \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ dtype=object) For Series and Indexes backed by normal NumPy arrays, Series.array will return a new arrays. PandasArray, which is a thin (no-copy) wrapper around a numpy.ndarray. PandasArray isn’t especially useful0 码力 | 2973 页 | 9.90 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.3.2
. . . . . . . . . . . . . . . . . . . . 419 2.5.16 Setting with enlargement conditionally using numpy() . . . . . . . . . . . . . . . . . . . 423 2.5.17 The query() Method . . . . . . . . . . . . . and NA type promotions . . . . . . . . . . . . . . . . . . . . . . . . 935 2.26.5 Differences with NumPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938 2.26.6 Thread-safety 3.8, and 3.9. Installing pandas Installing with Anaconda Installing pandas and the rest of the NumPy and SciPy stack can be a little difficult for inexperienced users. The simplest way to install not0 码力 | 3509 页 | 14.01 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.3.3
. . . . . . . . . . . . . . . . . . . . 438 2.5.16 Setting with enlargement conditionally using numpy() . . . . . . . . . . . . . . . . . . . . 442 2.5.17 The query() Method . . . . . . . . . . . . and NA type promotions . . . . . . . . . . . . . . . . . . . . . . . . 975 2.26.5 Differences with NumPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 978 2.26.6 Thread-safety 3.8, and 3.9. Installing pandas Installing with Anaconda Installing pandas and the rest of the NumPy and SciPy stack can be a little difficult for inexperienced users. The simplest way to install not0 码力 | 3603 页 | 14.65 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.3.4
. . . . . . . . . . . . . . . . . . . . 438 2.5.16 Setting with enlargement conditionally using numpy() . . . . . . . . . . . . . . . . . . . . 442 2.5.17 The query() Method . . . . . . . . . . . . and NA type promotions . . . . . . . . . . . . . . . . . . . . . . . . 976 2.26.5 Differences with NumPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 979 2.26.6 Thread-safety 3.8, and 3.9. Installing pandas Installing with Anaconda Installing pandas and the rest of the NumPy and SciPy stack can be a little difficult for inexperienced users. The simplest way to install not0 码力 | 3605 页 | 14.68 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.1.1
and NA type promotions . . . . . . . . . . . . . . . . . . . . . . . . 873 2.24.4 Differences with NumPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875 2.24.5 Thread-safety 3.7, and 3.8. Installing pandas Installing with Anaconda Installing pandas and the rest of the NumPy and SciPy stack can be a little difficult for inexperienced users. The simplest way to install not not only pandas, but Python and the most popular packages that make up the SciPy stack (IPython, NumPy, Matplotlib, ...) is with Anaconda, a cross-platform (Linux, Mac OS X, Windows) Python distribution0 码力 | 3231 页 | 10.87 MB | 1 年前3pandas: powerful Python data analysis toolkit - 1.1.0
and NA type promotions . . . . . . . . . . . . . . . . . . . . . . . . 873 2.24.4 Differences with NumPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 875 2.24.5 Thread-safety 3.7, and 3.8. Installing pandas Installing with Anaconda Installing pandas and the rest of the NumPy and SciPy stack can be a little difficult for inexperienced users. The simplest way to install not not only pandas, but Python and the most popular packages that make up the SciPy stack (IPython, NumPy, Matplotlib, ...) is with Anaconda, a cross-platform (Linux, Mac OS X, Windows) Python distribution0 码力 | 3229 页 | 10.87 MB | 1 年前3
共 349 条
- 1
- 2
- 3
- 4
- 5
- 6
- 35