Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to get single element from arraylist in numpy arrayt

>>> import numpy as np
>>> np_arr = np.array([[1,2,3], [4,5,6], [7,8,9]])
>>> np_arr
array([[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9]])
>>> arr = [ele[0] for ele in np_arr]
>>> arr
[1, 4, 7]
Comment

PREVIOUS NEXT
Code Example
Python :: how to get a rectangular grid out of two given one-dimensional arrays 
Python :: example of input int questions in python with if statement 
Python :: give utton a number python 
Python :: how to get foregine key field from models 
Python :: tkinter titre fenetre 
Python :: python time modülü 
Python :: lambda if else nothing python 
Python :: gpt2 simple restore_from 
Python :: bashrc rc meaning 
Python :: Console code page (437) differs from Windows code page (1252) 8-bit characters might not work correctly 
Python :: python copy sequence 
Python :: how to dynamically search for a class variable in python 
Python :: django datepicker mindate and maxdate 
Python :: linux desktop files location python 
Python :: flask-restx custom ui 
Python :: mute button tkinter 
Python :: Perform a left outer join of self and other. 
Python :: there is no difference in R between a string scalar and a vector of strings 
Python :: cdf empírica python 
Python :: matplot lib mehrere bilder nebeneinander 
Python :: restore tf model python ValueError: Unknown loss function:smoothL1 
Python :: idwt pywt 
Python :: how to respond to a number in python 
Python :: cache in django 
Python :: collecting candies codevita solution in python 
Python :: matplotlib csv-datei anpassen und verwenden 
Python :: TemplateSyntaxError 
Python :: xkcd remove feature matplotlib 
Python :: python diccionario setdefault 
Python :: matrix outer product python 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =