Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python make 1d array from n-d array

import numpy as np
a = np.array([[1, 2],
       [3, 4],
       [5, 6]])
a_flat = a.flatten()
print(f"original array: {a} 
flattened array = {a_flat}")
Comment

PREVIOUS NEXT
Code Example
Python :: pyqt tutorial 
Python :: Modify a Python interpreter 
Python :: Write byte data in file python 
Python :: Add PostgreSQL Settings in Django 
Python :: import matlab python 
Python :: remove string from list in python 
Python :: how to make tkinter look better 
Python :: save image to file from URL 
Python :: python timedelta years 
Python :: python add commas to list 
Python :: Converting Dataframe from list Using a list in the dictionary 
Python :: pthon return value with highest occurences 
Python :: xlabel font type matplotlib 
Python :: find nan values in pandas 
Python :: invert list python 
Python :: Python list files only in given directory 
Python :: a sigmoid function 
Python :: how to initialize set in python 
Python :: if condition in print statement python 
Python :: How do I stop Selenium from closing my browser 
Python :: django signals 
Python :: python list input print 
Python :: download unsplash images python without api 
Python :: python while 
Python :: python not in 
Python :: how to take input of something in python 
Python :: twitter api tutorial python 
Python :: docker opencv python libGL.so.1: cannot open shared object file: No such file or directory 
Python :: numpy random 
Python :: hide tkinter window 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =