> For the complete documentation index, see [llms.txt](https://euclid-jie.gitbook.io/euclid_jie_s_book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://euclid-jie.gitbook.io/euclid_jie_s_book/python/numpy-xiang-guan.md).

# Numpy函数

`Numpy`和`Pandas`同等地位的存在，但是我实际用到的不多

#### np.cunsum()

累加

```python
self.wheredf['cumsum'] = np.cumsum(self.SecDatadf.TradVolume)
```

#### np.max(df)

可以直接取得df中的最大值，还挺不错，min也是一样

```Python
mymax = np.max(df)
```

#### np.issubdtype

`np.issubdtype`函数可以检查一个数据类型是否为另一个数据类型的子类型。可以将其与`np.float`传递给`dtype`属性进行比较，如下所示：

```python
import numpy as np
a = np.array([1, 2, 3, 4, 5], dtype=np.float32)
assert np.issubdtype(a.dtype, np.float)
```

这样就可以确保`a.dtype`是`float32`或`float64`，并且断言将不会引发错误。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://euclid-jie.gitbook.io/euclid_jie_s_book/python/numpy-xiang-guan.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
