Top 50 파이썬 Reshape 14847 People Liked This Answer

You are looking for information, articles, knowledge about the topic nail salons open on sunday near me 파이썬 reshape on Google, you do not find the information you need! Here are the best content compiled and compiled by the https://chewathai27.com/to team, along with other related topics such as: 파이썬 reshape 파이썬 shape, Reshape, Numpy reshape, np.reshape order, np.reshape 2d to 3d, List reshape, Python list reshape, ‘list’ object has no attribute ‘reshape’


numpy reshape (-1 1)은 무엇을 의미합니까?
numpy reshape (-1 1)은 무엇을 의미합니까?


[ Python 3 ] Numpy reshape 함수란. (추가, 다른 형태의 자료를 np.array 활용하여 reshape 이용 가능)

  • Article author: supermemi.tistory.com
  • Reviews from users: 13335 ⭐ Ratings
  • Top rated: 4.5 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about [ Python 3 ] Numpy reshape 함수란. (추가, 다른 형태의 자료를 np.array 활용하여 reshape 이용 가능) [ Python 3 ] Numpy reshape 함수란. (추가, 다른 형태의 자료를 np.array 활용하여 reshape 이용 가능). by SuperMemi 2020. 3. 13. …
  • Most searched keywords: Whether you are looking for [ Python 3 ] Numpy reshape 함수란. (추가, 다른 형태의 자료를 np.array 활용하여 reshape 이용 가능) [ Python 3 ] Numpy reshape 함수란. (추가, 다른 형태의 자료를 np.array 활용하여 reshape 이용 가능). by SuperMemi 2020. 3. 13. 머신러닝이나 딥러닝을 하다보면 데이터의 구조를 바꿔서 처리할 때가 많은데 이때, numpy reshape을 많이 사용한다. reshape 함수는 numpy.ndarray의 차원과 모양을 바꿔준다. numpy.ndarray를 잘 모르겠다면 아..
  • Table of Contents:

태그

관련글

댓글0

공지사항

최근글

인기글

최근댓글

태그

전체 방문자

티스토리툴바

[ Python 3 ] Numpy reshape 함수란. (추가, 다른 형태의 자료를 np.array 활용하여 reshape 이용 가능)
[ Python 3 ] Numpy reshape 함수란. (추가, 다른 형태의 자료를 np.array 활용하여 reshape 이용 가능)

Read More

[Python] 구조의 재배열, numpy.reshape 함수 – yg’s blog

  • Article author: yganalyst.github.io
  • Reviews from users: 37632 ⭐ Ratings
  • Top rated: 3.7 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about [Python] 구조의 재배열, numpy.reshape 함수 – yg’s blog reshape 함수는 np.reshape(변경할 배열, 차원) 또는 배열.reshape(차원) 으로 사용 할 수 있으며, 현재의 배열의 차원(1차원,2차원,3차원)을 변경 … …
  • Most searched keywords: Whether you are looking for [Python] 구조의 재배열, numpy.reshape 함수 – yg’s blog reshape 함수는 np.reshape(변경할 배열, 차원) 또는 배열.reshape(차원) 으로 사용 할 수 있으며, 현재의 배열의 차원(1차원,2차원,3차원)을 변경 … 구조의 재배열을 통해 차원을 변환해주는 reshape함수에 대해 알아보자
  • Table of Contents:

Skip links

1-1 1차원과 2차원 변환

1-2 3차원 변환

2-1 reshape(-1정수) 행의 위치에 -1인 경우

2-2 reshape(정수-1) 열의 위치에 -1인 경우

2-3 reshape(-1)인 경우

[ML] 은닉 마르코프 모델 (Hidden Markov Model HMM)

[Anaconda] 아나콘다 가상환경 IDE와 연동하기

[Anaconda] 아나콘다 가상환경의 개념 및 활용방법

[클러스터링] 비계층적(K-means DBSCAN) 군집분석

[Python] 구조의 재배열, numpy.reshape 함수 - yg’s blog
[Python] 구조의 재배열, numpy.reshape 함수 – yg’s blog

Read More

numpy.reshape — NumPy v1.23 Manual

  • Article author: numpy.org
  • Reviews from users: 42257 ⭐ Ratings
  • Top rated: 4.9 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about numpy.reshape — NumPy v1.23 Manual Gives a new shape to an array without changing its data. Parameters. aarray_like. Array to be reshaped. newshapeint or tuple of ints. …
  • Most searched keywords: Whether you are looking for numpy.reshape — NumPy v1.23 Manual Gives a new shape to an array without changing its data. Parameters. aarray_like. Array to be reshaped. newshapeint or tuple of ints.
  • Table of Contents:
numpy.reshape — NumPy v1.23 Manual
numpy.reshape — NumPy v1.23 Manual

Read More

[Numpy] 배열 shape 변경 : np.reshape 함수 사용법, -1 의미

  • Article author: jimmy-ai.tistory.com
  • Reviews from users: 17500 ⭐ Ratings
  • Top rated: 4.3 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about [Numpy] 배열 shape 변경 : np.reshape 함수 사용법, -1 의미 파이썬 넘파이 배열 차원 변경 함수 : np.reshape reshape 함수를 통하여 넘파이 배열의 차원을 변환하는 방법에 대해서 살펴보고, 함수 내 input으로 … …
  • Most searched keywords: Whether you are looking for [Numpy] 배열 shape 변경 : np.reshape 함수 사용법, -1 의미 파이썬 넘파이 배열 차원 변경 함수 : np.reshape reshape 함수를 통하여 넘파이 배열의 차원을 변환하는 방법에 대해서 살펴보고, 함수 내 input으로 … 파이썬 넘파이 배열 차원 변경 함수 : np.reshape reshape 함수를 통하여 넘파이 배열의 차원을 변환하는 방법에 대해서 살펴보고, 함수 내 input으로 -1을 포함한 경우의 의미도 살펴보도록 하겠습니다. np.resha..
  • Table of Contents:
[Numpy] 배열 shape 변경 npreshape 함수 사용법 -1 의미

파이썬 넘파이 배열 차원 변경 함수 npreshape

티스토리툴바

[Numpy] 배열 shape 변경 : np.reshape 함수 사용법, -1 의미
[Numpy] 배열 shape 변경 : np.reshape 함수 사용법, -1 의미

Read More

[Python] numpy.reshape의 -1 의미 및 기능

  • Article author: domybestinlife.tistory.com
  • Reviews from users: 45342 ⭐ Ratings
  • Top rated: 3.3 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about [Python] numpy.reshape의 -1 의미 및 기능 파이썬의 NumPy를 이용 시 배열 차원(Dimension)을 재구조화 및 변경하고자 할 때 reshape() 함수를 사용합니다. 예를 들어, 3개의 행과 4개의 열로 … …
  • Most searched keywords: Whether you are looking for [Python] numpy.reshape의 -1 의미 및 기능 파이썬의 NumPy를 이용 시 배열 차원(Dimension)을 재구조화 및 변경하고자 할 때 reshape() 함수를 사용합니다. 예를 들어, 3개의 행과 4개의 열로 … 파이썬의 NumPy를 이용 시 배열 차원(Dimension)을 재구조화 및 변경하고자 할 때 reshape() 함수를 사용합니다.  예를 들어, 3개의 행과 4개의 열로 구성된 2차원의 배열로 재설정 시 reshape(3, 4)처럼 reshap..
  • Table of Contents:

고정 헤더 영역

메뉴 레이어

검색 레이어

상세 컨텐츠

태그

추가 정보

페이징

티스토리툴바

[Python] numpy.reshape의 -1 의미 및 기능
[Python] numpy.reshape의 -1 의미 및 기능

Read More

[Python] Numpy – 배열 reshape

  • Article author: island-developer.tistory.com
  • Reviews from users: 25724 ⭐ Ratings
  • Top rated: 3.5 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about [Python] Numpy – 배열 reshape 배열 reshape. Numpy배열은 원소의 개수가 유지되는 경우에 자유롭게 다른 shape로 변경이 가능하다. arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, … …
  • Most searched keywords: Whether you are looking for [Python] Numpy – 배열 reshape 배열 reshape. Numpy배열은 원소의 개수가 유지되는 경우에 자유롭게 다른 shape로 변경이 가능하다. arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, … 배열 reshape Numpy배열은 원소의 개수가 유지되는 경우에 자유롭게 다른 shape로 변경이 가능하다. arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]) print(arr) #4*3 #[[ 1 2 3] #[ 4 5 6] #[..
  • Table of Contents:

태그

관련글

댓글0

공지사항

최근글

인기글

최근댓글

태그

전체 방문자

[Python] Numpy - 배열 reshape
[Python] Numpy – 배열 reshape

Read More

numpy.reshape() in Python – GeeksforGeeks

  • Article author: www.geeksforgeeks.org
  • Reviews from users: 43427 ⭐ Ratings
  • Top rated: 5.0 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about numpy.reshape() in Python – GeeksforGeeks numpy.reshape() in Python … The numpy.reshape() function shapes an array without changing the data of the array. … Return Type: Array which is … …
  • Most searched keywords: Whether you are looking for numpy.reshape() in Python – GeeksforGeeks numpy.reshape() in Python … The numpy.reshape() function shapes an array without changing the data of the array. … Return Type: Array which is … Data Structures,Algorithms,Python,Java,C,C++,JavaScript,Android Development,SQL,Data Science,Machine Learning,PHP,Web Development,System Design,Tutorial,Technical Blogs,Interview Experience,Interview Preparation,Programming,Competitive Programming,SDE Sheet,Job-a-thon,Coding Contests,GATE CSE,HTML,CSS,React,NodeJS,Placement,Aptitude,Quiz,Computer Science,Programming Examples,GeeksforGeeks Courses,PuzzlesA Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
  • Table of Contents:

Related Articles

Python

Start Your Coding Journey Now!

numpy.reshape() in Python - GeeksforGeeks
numpy.reshape() in Python – GeeksforGeeks

Read More

[numpy] reshape

  • Article author: velog.io
  • Reviews from users: 43435 ⭐ Ratings
  • Top rated: 5.0 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about [numpy] reshape 12개의 요소가 있는 1차원 리스트를 3*4 형태의 2차원 ndarray로 변경하였습니다. # 1. numpy import import numpy as np # 2. 파이썬 리스트 base_list = … …
  • Most searched keywords: Whether you are looking for [numpy] reshape 12개의 요소가 있는 1차원 리스트를 3*4 형태의 2차원 ndarray로 변경하였습니다. # 1. numpy import import numpy as np # 2. 파이썬 리스트 base_list = … numpy reshape에 대해 알아봅시다.
  • Table of Contents:
[numpy] reshape
[numpy] reshape

Read More

NUMPY 모양 변경 예 | 파이썬의 NP RESHAPE() 함수 – 블로그

  • Article author: ko.quish.tv
  • Reviews from users: 46535 ⭐ Ratings
  • Top rated: 3.2 ⭐
  • Lowest rated: 1 ⭐
  • Summary of article content: Articles about NUMPY 모양 변경 예 | 파이썬의 NP RESHAPE() 함수 – 블로그 Numpy reshape() 이해하기. Python numpy.reshape(array, shape, order = ‘C’) 함수는 배열의 데이터를 변경하지 않고 배열을 형성합니다. …
  • Most searched keywords: Whether you are looking for NUMPY 모양 변경 예 | 파이썬의 NP RESHAPE() 함수 – 블로그 Numpy reshape() 이해하기. Python numpy.reshape(array, shape, order = ‘C’) 함수는 배열의 데이터를 변경하지 않고 배열을 형성합니다. 개발자가 버그 및 문제에 대한 주제를 토론하고 지식을 작성 및 공유하며 전 세계 수백만 개발자와 연결할 수 있는 소셜 네트워크입니다.개발자가 버그 및 문제에 대한 주제를 토론하고 지식을 작성 및 공유하며 전 세계 수백만 개발자와 연결할 수 있는 소셜 네트워크입니다.
  • Table of Contents:

appdividendcom

Numpy 모양 변경 예 파이썬의 np reshape() 함수

NUMPY 모양 변경 예 | 파이썬의 NP RESHAPE() 함수 - 블로그
NUMPY 모양 변경 예 | 파이썬의 NP RESHAPE() 함수 – 블로그

Read More


See more articles in the same category here: Top 721 tips update new.

[ Python 3 ] Numpy reshape 함수란. (추가, 다른 형태의 자료를 np.array 활용하여 reshape 이용 가능)

반응형

머신러닝이나 딥러닝을 하다보면 데이터의 구조를 바꿔서 처리할 때가 많은데

이때, numpy reshape을 많이 사용한다.

reshape 함수는 numpy.ndarray의 차원과 모양을 바꿔준다.

numpy.ndarray를 잘 모르겠다면 아래의 글을 보고 오길 바란다.

2020/03/14 – [Python] – [ Python 3 ] NumPy란 무엇인가? (ndarray 클래스)

Tip. 데이터의 개수와 형태의 크기는 같아야한다.

Tip. ndarray가 아닌 다른 자료(list, tuple, range)를 바로 reshape하려면 오류가 뜬다.

이럴 때는, np.array()와 tolist()함수를 이용하자.

1. 이때 원래의 데이터는 변하지않고 그대로 유지된다.

2. reshape(n, -1) 같이 -1을 이용해서 나타 낼 수도 있다.

– n의 크기에 맞추어 형태를 정해준다.

3. 다차원 list data, range tuple 자료를 numpy npdarray로 바꾸어 reshape 하기.

예제 1. reshape함수 및 본래 데이터 유지

>>> x = np.arange(20) # x는 1차원 배열이다. >>> x array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]) >>> x.reshape(4,5) # x를 (4,5) 2차원으로 바꾼 배열을 리턴한다. array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19]]) >>> x.reshape(2,2,5) # x를 (2,2,5) 3차원으로 바꾼 배열을 리턴한다. array([[[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9]], [[10, 11, 12, 13, 14], [15, 16, 17, 18, 19]]]) >>> x # x는 변화하지 않고 그대로 유지됨을 볼 수 있다. array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])

예제 2. reshape(-1에 대하여)

>>> import numpy as np >>> x = np.arange(20) # 1차원 배열. >>> y = x.reshape(4, -1) # 데이터개수(20개) = 2차원(4) X 1차원(?) >>> y # 크기가 맞아야 함으로, -1 자리에는 5개로 채워진다. array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19]]) >>> y.shape (4, 5) >>> y = x.reshape(2, 5, -1) # 데이터개수(20개) = 3차원(2) X 2차원(5) X 1차원(?) >>> y # 크기가 맞아야 함으로, -1 자리에는 2개로 채워진다. array([[[ 0, 1], [ 2, 3], [ 4, 5], [ 6, 7], [ 8, 9]], [[10, 11], [12, 13], [14, 15], [16, 17], [18, 19]]]) >>> y.shape (2, 5, 2) >>> y.reshape(-1) # 데이터개수(20개) = 1차원(?) -> 당연히 20이 될것이다. array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])

예제 3. 다차원 list data를 reshape 하기. np.array(), tolist().

>>> list_data = [[[1,2,3],[4,5,6]],[[7,8,9],[10,11,12]]] # 3차원 (2,2,3) 리스트 데이터. >>> list_data.reshape(2,3,2) Traceback (most recent call last): File ““, line 1, in AttributeError: ‘list’ object has no attribute ‘reshape’ # list는 reshape을 바로 이용할 수 없다. >>> data = np.array(list_data) # np.array()를 이용하여, >>> type(data) # list를 ndarray로 바꿔준다. >>> data.reshape(2,3,2) # 3차원 (2,3,2) ndarray가 되었다. array([[[ 1, 2], [ 3, 4], [ 5, 6]], [[ 7, 8], [ 9, 10], [11, 12]]]) >>> list_data2 = data.tolist() # 다시 리스트 형태로 바꾸고 싶다면 tolist()함수를 사용한다. >>> list_data2 [[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]

range 함수와 tuple 자료도 np.array()를 이용하여 reshape할 수 있다.

>>> x = range(12) >>> data = np.array(x).reshape(2,2,3) >>> data array([[[ 0, 1, 2], [ 3, 4, 5]], [[ 6, 7, 8], [ 9, 10, 11]]]) >>> x = (1,2,3,4) >>> data = np.array(x).reshape(2,2) >>> data array([[1, 2], [3, 4]])

반응형

[Python] 구조의 재배열, numpy.reshape 함수

1. 배열과 차원을 변형해주는 reshape

reshape 함수는 np.reshape(변경할 배열, 차원) 또는 배열.reshape(차원) 으로 사용 할 수 있으며, 현재의 배열의 차원(1차원,2차원,3차원)을 변경하여 행렬을 반환하거나 하는 경우에 많이 이용되는 함수이다.

1-1. 1차원과 2차원 변환

먼저 1차원 배열을 생성하고 변환해보자.

배열은 넘파이의 array말고도 리스트 등도 올 수 있다.

import numpy as np a = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ] b = np . reshape ( a ,( 2 , 4 )) c = np . reshape ( a ,( 4 , 2 )) print ( b ) print ( ‘

‘ ) print ( c )

[[1 2 3 4] [5 6 7 8]] [[1 2] [3 4] [5 6] [7 8]]

차원은 대괄호의 개수로 알수도 있다.

1-2. 3차원 변환

a = np . arange ( 1 , 9 ) b = a . reshape ( 2 , 2 , 2 ) b

array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])

b [ 0 ]

array([[1, 2], [3, 4]])

3차원에서 첫 번째 행렬의 1행 2열 값 인덱싱

b [ 0 ][ 0 , 1 ]

2

2. reshape 에서 -1의 의미

reshape 를 활용하는 경우를 보다 보면 입력인수로 -1이 들어간 경우가 종종 있다.

reshape()의 ‘-1’이 의미하는 바는, 변경된 배열의 ‘-1’ 위치의 차원은 “원래 배열의 길이와 남은 차원으로 부터 추정”이 된다는 뜻이다.

말이 좀 어려우나 차근차근 알아보자.

일단 배열을 하나 생성.

x = np . arange ( 12 ) x = x . reshape ( 3 , 4 ) x

array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]])

2-1. reshape(-1,정수) : 행의 위치에 -1인 경우

x . reshape ( – 1 , 1 )

array([[ 0], [ 1], [ 2], [ 3], [ 4], [ 5], [ 6], [ 7], [ 8], [ 9], [10], [11]])

x . reshape ( – 1 , 2 )

array([[ 0, 1], [ 2, 3], [ 4, 5], [ 6, 7], [ 8, 9], [10, 11]])

x . reshape ( – 1 , 3 )

array([[ 0, 1, 2], [ 3, 4, 5], [ 6, 7, 8], [ 9, 10, 11]])

즉, 행(row)의 위치에 -1을 넣고 열의 값을 지정해주면 변환될 배열의 행의 수는 알아서 지정이 된다는 소리이다.

2-2. reshape(정수,-1) : 열의 위치에 -1인 경우

x . reshape ( 1 , – 1 )

array([[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])

x . reshape ( 2 , – 1 )

array([[ 0, 1, 2, 3, 4, 5], [ 6, 7, 8, 9, 10, 11]])

x . reshape ( 3 , – 1 )

array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11]])

x . reshape ( 4 , – 1 )

array([[ 0, 1, 2], [ 3, 4, 5], [ 6, 7, 8], [ 9, 10, 11]])

이것도 마찬가지로, 이번엔 행(row)의 수를 지정해주면 열은 알아서 자동으로 재배열을 해주는 것이다.

2-3. reshape(-1) 인 경우

x . reshape ( – 1 )

array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11])

x . reshape ( 1 , – 1 )

array([[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]])

-1만 들어가면 1차원 배열을 반환한다. 모양상 x.reshape(1,-1) 과 같으나 이는 (1,12)인 2차원 배열이다.(대괄호의 수로 확인 가능하다.)

Reference

여기를 참조하여 포스팅하였습니다.

[Numpy] 배열 shape 변경 : np.reshape 함수 사용법, -1 의미

반응형

파이썬 넘파이 배열 차원 변경 함수 : np.reshape

reshape 함수를 통하여 넘파이 배열의 차원을 변환하는 방법에 대해서 살펴보고,

함수 내 input으로 -1을 포함한 경우의 의미도 살펴보도록 하겠습니다.

np.reshape 함수 기본 사용법

기본적인 사용 방법은 배열 a에 대하여

a.reshape(변환 shape) 혹은 np.reshape(a, 변환 shape)

형태로 사용해주시면 됩니다.

axis 순서대로(가로 -> 세로 축 방향) 값들을

변환되는 shape으로 재배정하는 원리이며,

재배정이 불가능한 shape인 경우 ValueError가 발생합니다.

1차원 배열에 대한 실행 예제입니다.

import numpy as np a = np.arange(9) # array([0, 1, 2, 3, 4, 5, 6, 7, 8]) a.reshape(3, 3) # np.reshape(a, (3, 3))으로도 사용 가능 ”’array([[0, 1, 2], [3, 4, 5], [6, 7, 8]])”’ a.reshape(2, 5) # ValueError: cannot reshape array of size 9 into shape (2,5) # 2 * 5가 9가 아니라서 발생

9개의 요소를 가진 1차원 배열을 3 * 3 배열로 변경이 가능합니다.

다만, (2, 5)의 shape으로는 9개의 요소를 표현할 수 없어 에러가 발생합니다.

reshape 함수 -1의 의미

특정 차원의 숫자로 -1을 넣는 경우도 자주 등장합니다.

-1을 넣은 자리에는 가능한 shape을 자동 계산하여 반영해주는 방식으로,

예를 들어, 8개의 사이즈에서 reshape(2, -1)로 넣으면,

(2, 4)로 자동 변환되는 방식입니다.

단, 2개 이상의 axis 자리에 -1이 포함되는 것은 불가능합니다.

2차원 배열을 통한 예제를 살펴보도록 하겠습니다.

b = np.array([[1, 2, 3, 4], [5, 6, 7, 8]]) b.reshape(2, 2, 2) # b.reshape(2, 2, -1)와 동일 ”’array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])”’ b.reshape(-1, 2) # b.reshape(4, 2)와 동일 ”’array([[1, 2], [3, 4], [5, 6], [7, 8]])”’ b.reshape(-1) # b.reshape(8)와 동일 # array([1, 2, 3, 4, 5, 6, 7, 8]) b.reshape(3, -1) # ValueError: cannot reshape array of size 8 into shape (3,newaxis) # 3 * n = 8을 만족하는 n이 정수가 아니라서 오류

reshape(-1)으로 지정하면, 모든 원소를 1차원 배열로 편 array를 반환하게 되며,

(3, -1) 같은 경우는 8이 3의 배수가 아니기에,

변환 가능한 차원이 없어 ValueError가 발생하게 됩니다.

반응형

So you have finished reading the 파이썬 reshape topic article, if you find this article useful, please share it. Thank you very much. See more: 파이썬 shape, Reshape, Numpy reshape, np.reshape order, np.reshape 2d to 3d, List reshape, Python list reshape, ‘list’ object has no attribute ‘reshape’

Leave a Comment