Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to convert 2 dimensional in 1 dimensional array

#source: https://www.kite.com/python/answers/how-to-convert-a-2d-numpy-array-to-a-1d-array-in-python

array_1d = array_2d. flatten() flatten `array_2d`
print(array_1d)
Comment

how to convert one dimensional array into two dimensional array

x = x.reshape(-1, 1)

# remember to check shape of your variable using x.shape, if it shows
# (y, n) then it is already 2D, if it shows (y,) instead, it is 1D.
Comment

PREVIOUS NEXT
Code Example
Python :: golng open file append 
Python :: import baseestimator 
Python :: How do I know which animation is playing animation player 
Python :: customise django admin edit model button in field 
Python :: .lowertkinter 
Python :: importing modules 
Python :: python addition 
Python :: blueprint flask 
Python :: c to python translator 
Python :: finding anagrams in python 
Python :: temp python 
Python :: python object has no attribute 
Python :: odd and even python 
Python :: syntax error python 
Python :: login view django 
Python :: add rectangle to image python 
Python :: python call function in the same class 
Python :: show post id on django admin interface 
Python :: python how to draw a rectangle 
Python :: rotate 2 dimensional list python 
Python :: django add user to group 
Python :: python len 
Python :: is_integer python 
Python :: python key 
Python :: python input - how to read a number 
Python :: mapping in python 
Python :: find key by value python 
Python :: pytest-mock tutorial 
Python :: pyqt5 buttons 
Python :: a int and float python 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =