Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

array concatenation in python

#// required library
import numpy as npy

#// define 3 (1D) numpy arrays
arr1 = npy.array([10, 20, 30])
arr2 = npy.array([40, 50, 60])
arr3 = npy.array([70, 80, 90])

arrCon = npy.concatenate([arr1, arr2, arr3])
print(arrCon)

#// concatenation can also happen with 2D arrays
arr1_2d = npy.array([
  [10, 20, 30],
  [40, 50, 60]
])
arr2_2d = npy.array([
  [11, 22, 33],
  [44, 55, 66]
])

arr_2dCon = npy.concatenate([arr1_2d, arr2_2d])
print(arr_2dCon)
Comment

PREVIOUS NEXT
Code Example
Python :: concatenation array 
Python :: Add Cog to bot in Discord.py 
Python :: python beautifulsoup xpath 
Python :: if condition in print statement python 
Python :: scipy check normal distribution 
Python :: Flatten List in Python Using NumPy Reshape 
Python :: calculate mean of column pandas 
Python :: how to append to a dictionary in python 
Python :: get char from ascii value python 
Python :: check all true python 
Python :: BaseSSHTunnelForwarderError: Could not establish session to SSH gateway 
Python :: python scheduler 
Python :: unsplash python 
Python :: all possible combinations in python 
Python :: find the last point of line geopanda 
Python :: python check equality of floats 
Python :: discord.py permissions 
Python :: sort python 
Python :: can serializer returns an object in django 
Python :: regex to end with python 
Python :: sort dict 
Python :: python tkinter button image 
Python :: df index drop duplicates 
Python :: makemigration django 
Python :: argparse accept only few options 
Python :: python set attribute by string name 
Python :: confusion matrix with seaborn heatmap 
Python :: python if elif 
Python :: join tuple to string python 
Python :: pandas create average per group 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =