“Funkcja kształtu Python” Kod odpowiedzi

Co robi. Shape w Pythonie

#The shape attribute for numpy arrays returns the dimensions of the array. 
#If Y has n rows and m columns, then Y. shape is (n,m) .
import numpy as np
arr= np.array([[6, 1, 2, 1],
               [5, 4, 6, 7,],
               [6, 7, 2, 1,]])
result = np.shape(arr)
print(result)
#will return (3,4)
Gandalf

Funkcja kształtu Python

# Example from https://numpy.org/doc/stable/reference/generated/numpy.ndarray.shape.html
y = np.zeros((2, 3, 4))
y.shape # this returns (2, 3, 4)
CompSciGeek

Kształt zmiennego Pythona

variable.shape()
Massylia KHELAFI

Składnia funkcji kształtu Python Numpy

numpy.shape(array_name)
Outrageous Ostrich

Odpowiedzi podobne do “Funkcja kształtu Python”

Pytania podobne do “Funkcja kształtu Python”

Więcej pokrewnych odpowiedzi na “Funkcja kształtu Python” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu