Difference between Numpy (n,) and (n, 1) notation [Difference between horizontal vector and vertical vector]

Introduction

If you look at the shape of the Numpy ndarray array, you'll see notations such as (n, 1) and (n,). I wondered, "Isn't [,] or [1] unnecessary for a one-dimensional array?"

Conclusion

(n,) is an array of horizontal vectors (just a one-dimensional array)

(n, 1) is an array of vertical vectors

コメント 2019-12-22 203229.png

Recommended Posts

Difference between Numpy (n,) and (n, 1) notation [Difference between horizontal vector and vertical vector]
Difference between Numpy randint and Random randint
Difference between "categorical_crossentropy" and "sparse_categorical_crossentropy"
Difference between regression and classification
Difference between np.array and np.arange
Difference between MicroPython and CPython
Difference between ps a and ps -a
Difference between return and print-Python
Difference between java and python (memo)
Difference between list () and [] in Python
Difference between SQLAlchemy filter () and filter_by ()
Difference between == and is in python
Memorandum (difference between csv.reader and csv.dictreader)
(Note) Difference between gateway and default gateway
Difference between sort and sorted (memorial)
Difference between python2 series and python3 series dict.keys ()
Python / Numpy> Link> Difference between numpy.random and random.random> thread-safe or not
[Python] Difference between function and method
Difference between SQLAlchemy flush () and commit ()
Python --Difference between exec and eval
[Python] Difference between randrange () and randint ()
[Python] Difference between sorted and sorted (Colaboratory)
[Xg boost] Difference between softmax and softprob
difference between statements (statements) and expressions (expressions) in Python
Difference between PHP and Python finally and exit
Difference between @classmethod and @staticmethod in Python
Difference between append and + = in Python list
Difference between nonlocal and global in Python
[Python] Difference between class method and static method
Difference between docker-compose env_file and .env file
[Python Iroha] Difference between List and Tuple
[python] Difference between rand and randn output
speed difference between wsgi, Bottle and Flask
Differences between Numpy 1D array [x] and 2D array [x, 1]
Difference between numpy.ndarray and list (dimension, size)
Difference between ls -l and cat command
Difference and compatibility verification between keras and tf.keras # 1
Difference between using and import on shield language
About the difference between "==" and "is" in python
About the difference between PostgreSQL su and sudo
What is the difference between Unix and Linux?