Tile operation in numpy

A forum for general discussion of the Python programming language.

Tile operation in numpy

Postby tcp » Wed Oct 23, 2013 1:04 pm

I have a problem finding what does
Code: Select all
numpy.tile([0,1,2],(2,2))
and
Code: Select all
numpy.tile([0,1,2], (2, 1, 2))
do?

OUTPUT 1:
Code: Select all
array([[0, 1, 2, 0, 1, 2], [0, 1, 2, 0, 1, 2]])

OUTPUT 2:
Code: Select all
array([[[0, 1, 2, 0, 1, 2]], [[0, 1, 2, 0, 1, 2]]])
Last edited by Mekire on Wed Oct 23, 2013 2:48 pm, edited 1 time in total.
Reason: Lock. Code tags.
tcp
 
Posts: 1
Joined: Wed Oct 23, 2013 12:53 pm

Re: Tile operation in numpy

Postby micseydel » Wed Oct 23, 2013 6:21 pm

Code: Select all
import numpy
help(numpy.tile)
Join the #python-forum IRC channel on irc.freenode.net!
User avatar
micseydel
 
Posts: 939
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest