Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

convert 2d aray into 1d using python

import numpy as np

twoDAry = [6.4],[5.9],[5.5],[5.3],[5.1],[4.9],[4.5],[4.5],[4.5],[4.3],[4.2],[3.8],[3.5],[2.8],[2.8],[2.8]
twoDAry = np.array(twoDAry)
print(twoDAry.reshape(1, -1)[0])

# Output
# [6.4 5.9 5.5 5.3 5.1 4.9 4.5 4.5 4.5 4.3 4.2 3.8 3.5 2.8 2.8 2.8]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #aray #python
ADD COMMENT
Topic
Name
9+6 =