Numpy.zeros_like — NumPy V1.23 Manual
Có thể bạn quan tâm
- User Guide
- API reference
- Building from source
- Development
- Release notes
- Learn
- NEPs
- GitHub
Section Navigation
- NumPy’s module structure
- Array objects
- Universal functions (ufunc)
- Routines and objects by topic
- Constants
- Array creation routines
- numpy.empty
- numpy.empty_like
- numpy.eye
- numpy.identity
- numpy.ones
- numpy.ones_like
- numpy.zeros
- numpy.zeros_like
- numpy.full
- numpy.full_like
- numpy.array
- numpy.asarray
- numpy.asanyarray
- numpy.ascontiguousarray
- numpy.asmatrix
- numpy.astype
- numpy.copy
- numpy.frombuffer
- numpy.from_dlpack
- numpy.fromfile
- numpy.fromfunction
- numpy.fromiter
- numpy.fromstring
- numpy.loadtxt
- numpy.rec.array
- numpy.rec.fromarrays
- numpy.rec.fromrecords
- numpy.rec.fromstring
- numpy.rec.fromfile
- numpy.char.array
- numpy.char.asarray
- numpy.arange
- numpy.linspace
- numpy.logspace
- numpy.geomspace
- numpy.meshgrid
- numpy.mgrid
- numpy.ogrid
- numpy.diag
- numpy.diagflat
- numpy.tri
- numpy.tril
- numpy.triu
- numpy.vander
- numpy.bmat
- Array manipulation routines
- Bit-wise operations
- String functionality
- Datetime support functions
- Data type routines
- Mathematical functions with automatic domain
- Floating point error handling
- Exceptions and Warnings
- Discrete Fourier Transform
- Functional programming
- Input and output
- Indexing routines
- Linear algebra
- Logic functions
- Masked array operations
- Mathematical functions
- Miscellaneous routines
- Polynomials
- Random sampling
- Set routines
- Sorting, searching, and counting
- Statistics
- Test support
- Window functions
- Typing (numpy.typing)
- Packaging
- NumPy C-API
- Array API standard compatibility
- CPU/SIMD optimizations
- Thread Safety
- Global Configuration Options
- NumPy security
- Status of numpy.distutils and migration advice
- numpy.distutils user guide
- NumPy and SWIG
- NumPy reference
- Routines and objects by topic
- Array creation routines
- numpy.zeros_like
Return an array of zeros with the same shape and type as a given array.
Parameters: aarray_likeThe shape and data-type of a define these same attributes of the returned array.
dtypedata-type, optionalOverrides the data type of the result.
order{‘C’, ‘F’, ‘A’, or ‘K’}, optionalOverrides the memory layout of the result. ‘C’ means C-order, ‘F’ means F-order, ‘A’ means ‘F’ if a is Fortran contiguous, ‘C’ otherwise. ‘K’ means match the layout of a as closely as possible.
subokbool, optional.If True, then the newly created array will use the sub-class type of a, otherwise it will be a base-class array. Defaults to True.
shapeint or sequence of ints, optional.Overrides the shape of the result. If order=’K’ and the number of dimensions is unchanged, will try to keep order, otherwise, order=’C’ is implied.
devicestr, optionalThe device on which to place the created array. Default: None. For Array-API interoperability only, so must be "cpu" if passed.
New in version 2.0.0.
Returns: outndarrayArray of zeros with the same shape and type as a.
See also
empty_likeReturn an empty array with shape and type of input.
ones_likeReturn an array of ones with shape and type of input.
full_likeReturn a new array with shape of input filled with value.
zerosReturn a new array setting values to zero.
Examples
Try it in your browser! >>> importnumpyasnp >>> x = np.arange(6) >>> x = x.reshape((2, 3)) >>> x array([[0, 1, 2], [3, 4, 5]]) >>> np.zeros_like(x) array([[0, 0, 0], [0, 0, 0]]) >>> y = np.arange(3, dtype=float) >>> y array([0., 1., 2.]) >>> np.zeros_like(y) array([0., 0., 0.]) Go BackOpen In Tab On this page- zeros_like
Từ khóa » Np.zeros_like Là Gì
-
FundaML 1: Làm Việc Với Mảng Một Chiều
-
3.1. Khởi Tạo Một Mảng Trên Numpy — Deep AI KhanhBlog
-
Giới Thiệu Về Numpy (một Thư Viện Chủ Yếu Phục Vụ Cho Khoa Học ...
-
2.1. Thao Tác Với Dữ Liệu
-
Cách ưa Thích để Phân Bổ Trước Các Mảng NumPy Là Gì? - HelpEx
-
Tổng Quan Thư Viện NumPy Trong Python - Blog | Got It AI
-
Thắc Mắc Về Code Hiển Thị Dữ Liệu Trên đồ Thị (K-Means)
-
Vẽ đồ Thị ảnh động Trong Python Với Thư Viện Animation ... - All Laravel
-
Keras Backends -tìm Hiểu Kiến Thức Cơ Bản - W3seo
-
Tensorflow Turtorial | Kaggle
-
Phát Hiện Làn đường Với Python Và OpenCV - Computer Vision
-
Xem Tất Cả Các Thuộc Tính, Phương Thức, Module Con Của Một đối ...
-
Thư Viện NumPy | The Prosperous Heart
-
Dự đoán Doanh Số Bán Của Các Cửa Hàng Walmart - Phạm Duy Tùng