1 Star 0 Fork 0

hui/python-study

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
numpy-test.py 546 Bytes
Copy Edit Raw Blame History
litonghui authored 2026-04-02 19:40 +08:00 . 4.2
import numpy as np
array = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
print(f'number of dim:{array.ndim}')
print(f'shape:{array.shape}')
print(f'size:{array.size}')
print(f'dtype:{array.dtype}')
a = np.array([2, 23, 4], dtype=np.int64)
print(a.dtype)
z = np.zeros((3, 4), dtype=np.int64)
print(z)
e = np.empty((3, 4))
print(f'empty:{e},dtype:{e.dtype}')
r = np.arange(10, 20, 2)
print(r)
rr = np.arange(10, 22).reshape((3, 4))
print(rr)
l = np.linspace(0, 10, 20)
print(f'linspace{l},dtype:{l.dtype}')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/goldit/python-study.git
git@gitee.com:goldit/python-study.git
goldit
python-study
python-study
master

Search