Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'assignment': 0.07; 'arrays': 0.09; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'subject:into': 0.09; '(1,': 0.16; '480,': 0.16; 'numpy': 0.16; 'received:67.192.241.150': 0.16; 'received:smtp150.dfw.emailsrvr.com': 0.16; 'stuart': 0.16; 'subject:Convert': 0.16; 'subject:array': 0.16; 'wrote:': 0.18; 'advance.': 0.19; 'everyone,': 0.19; 'shape': 0.19; '>>>': 0.22; 'header:User-Agent:1': 0.23; '>>>': 0.24; 'received:emailsrvr.com': 0.24; 'received:(smtp server)': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'array': 0.29; 'gary': 0.31; 'convert': 0.35; 'thanks': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'simple': 0.61; 'charset:windows-1252': 0.65; 'received:10.10': 0.74 X-Virus-Scanned: OK X-Sender-Id: gary.herron@islandtraining.com Date: Wed, 27 Aug 2014 12:34:07 -0700 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Convert 3d NumPy array into 2d References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------030903060006040900020606" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 76 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409168507 news.xs4all.nl 2898 [2001:888:2000:d::a6]:53506 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77158 This is a multi-part message in MIME format. --------------030903060006040900020606 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 08/27/2014 08:08 AM, phinn stuart wrote: > Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy array > into (480L, 1440L)? > > Thanks in the advance. > > phinn > > A simple assignment into the arrays shape does it: >>> a = numpy.zeros((1,480,1440)) >>> a.shape (1, 480, 1440) >>> a.shape = (480,1440) >>> a.shape (480, 1440) Gary Herron --------------030903060006040900020606 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
On 08/27/2014 08:08 AM, phinn stuart wrote:
Hi everyone, how can I convert=A0(1L, 480L, 1440L)= shaped numpy array into (480L, 1440L)?

Thanks in the advance.

phinn



A simple assignment into the arrays shape does it:
>>> a =3D numpy.zeros((1,480,1440))
>>> a.shape
(1, 480, 1440)
>>> a.shape =3D (480,1440)
>>> a.shape
(480, 1440)

Gary Herron


--------------030903060006040900020606--