Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

numpy array with 2 times each value

>>> np.repeat(3, 4)
array([3, 3, 3, 3])

>>> x = np.array([1,2,3,4])
>>> np.repeat(x, 2)
array([1, 1, 2, 2, 3, 3, 4, 4])
Comment

PREVIOUS NEXT
Code Example
Python :: python django model range validation 
Python :: pandas select first within groupby 
Python :: qfiledialog python save 
Python :: how to scrape multiple pages using selenium in python 
Python :: append python 
Python :: how to multiply a string in python 
Python :: how to loop over list 
Python :: grouped bar chart matplotlib 
Python :: zero crossing rate python 
Python :: how to change the values of a column in numpy array 
Python :: python plot groupby 
Python :: pygame tutorial 
Python :: python create directory if non existent 
Python :: python character list to string 
Python :: for loop with enumerate python 
Python :: add caption to plot python 
Python :: convert timestamp to date python 
Python :: opencv shift image python 
Python :: python count occurrences of an item in a list 
Python :: how to install python libraries using pip 
Python :: create a dictionary from a list python 
Python :: calculate mean median mode in python 
Python :: is python oop 
Python :: how to use label encoding in python 
Python :: minmaxscaler python 
Python :: install aws sdk python 
Python :: how to make python open a program/desktop app 
Python :: python time sleep 
Python :: iterate over classes in module python 
Python :: make an android app with python 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =