Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

np.r_

import numpy as np
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
c = np.c_[a,b]

print(np.r_[a,b])
print(c)
print(np.c_[c,a])

[1 2 3 4 5 6]

[[1 4]
 [2 5]
 [3 6]]
 
[[1 4 1]
 [2 5 2]
 [3 6 3]]
Comment

python numpy r_

>>> np.r_[np.array([1,2,3]), 0, 0, np.array([4,5,6])]
array([1, 2, 3, ..., 4, 5, 6])
>>> np.r_[-1:1:6j, [0]*3, 5, 6]
array([-1. , -0.6, -0.2,  0.2,  0.6,  1. ,  0. ,  0. ,  0. ,  5. ,  6. ])
Comment

PREVIOUS NEXT
Code Example
Python :: how to find a square root of a number using python 
Python :: import class from another file python 
Python :: for loop get rid of stop words python 
Python :: how to reference variable in another file python 
Python :: python slit 
Python :: format column from string to numeric in python 
Python :: while loop odd numbers python 
Python :: .split python 
Python :: python requests-session for websites with login 
Python :: floating point python 
Python :: split and only grab first part of string 
Python :: timedelta python days 
Python :: python logo png 
Python :: how to username in python? 
Python :: python - find columns that are objects 
Python :: create tables with psycopg2 python 
Python :: django admin create project 
Python :: four digit representation python 
Python :: python *x 
Python :: pyaduio 
Python :: python fibonacci function 
Python :: python remove duplicates from list of dict 
Python :: labelencoder update 
Python :: pip matplotlib 
Python :: how to add captcha in django forms 
Python :: replace characters in string python 
Python :: how to hide ticks marks in matplotlib 
Python :: range of y & x in scatter 
Python :: raspi setup gpio 
Python :: python add item to list 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =