Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32001

Re: turn list of letters into an array of integers

Path csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <demianbrecht@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.026
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'subject:into': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.10; 'iteration.': 0.16; 'map(int,': 0.16; 'needless': 0.16; 'subject:array': 0.16; "shouldn't": 0.17; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'second': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'skip:@ 10': 0.27; 'subject:list': 0.28; 'sleep': 0.29; "i'm": 0.29; 'received:209.85.160.46': 0.32; 'int': 0.33; 'received:google.com': 0.34; 'done': 0.34; 'list': 0.35; 'received:192.168.0': 0.35; 'received:209.85': 0.35; 'message- id:@gmail.com': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'received:192': 0.39; 'list,': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'map': 0.61; 'header:Message-Id:1': 0.62
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=MxpkRmlq5exjxauJSYuJHDLL7Gq0lt905iVyFGjKJyg=; b=sDE3FyBRQDxcfuyip3hmMmwIaC93zap4sJr86u3fmaSvuNwWlVymBRa4haSHxXgcuR DFP1fv1waUpKqZQFc4K9ODR/gWPt7QGENqJrRMCmEqElPq3xelf02Fo9+dHeirGn6sJk 7MaY4NTK/HcH+UrKnSO1vh5pu86sYNHP5mc5ngkZtocmsovQAsKHN+q0+rZ0+0lsxCHW duhpgzp6D2FbqiKk8HZ1d3TKIBTWl8eAnkak6o+ZxwfIHW5cb7/iX5YdMFBRJhae41RC lN/7dB2+WAx0IY/fChIp/VSg68033Yn1vtTXMivGilXeCNzTFrfAF564aVpjHubwmcCm 9/Tg==
Content-Type text/plain; charset=us-ascii
Mime-Version 1.0 (Mac OS X Mail 6.0 \(1485\))
Subject Re: turn list of letters into an array of integers
From Demian Brecht <demianbrecht@gmail.com>
In-Reply-To <F189C287-64D2-44D5-98EB-086E73747EED@gmail.com>
Date Tue, 23 Oct 2012 22:54:30 -0700
Content-Transfer-Encoding quoted-printable
References <07073002-d79f-46f6-83fc-8d20c51b39c3@googlegroups.com> <A764F6A1-B1B5-43F8-8AB3-43E908C094C5@gmail.com> <F189C287-64D2-44D5-98EB-086E73747EED@gmail.com>
To seektime <michael.j.krause@gmail.com>
X-Mailer Apple Mail (2.1485)
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2724.1351058076.27098.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1351058076 news.xs4all.nl 6890 [2001:888:2000:d::a6]:47527
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:32001

Show key headers only | View raw


> Of course, if you want these to be ints, then you can either change the format of your int list, or map(int, list_) if you don't have control over it.


Ugh, I'm tired. Shouldn't map it, the conversion should be done in the list comprehension to avoid a needless second list iteration.

K, I'm going to sleep now. :P

Demian Brecht
@demianbrecht
http://demianbrecht.github.com



Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

turn list of letters into an array of integers seektime <michael.j.krause@gmail.com> - 2012-10-23 22:23 -0700
  Re: turn list of letters into an array of integers Demian Brecht <demianbrecht@gmail.com> - 2012-10-23 22:45 -0700
  Re: turn list of letters into an array of integers David Hutto <dwightdhutto@gmail.com> - 2012-10-24 01:50 -0400
  Re: turn list of letters into an array of integers Demian Brecht <demianbrecht@gmail.com> - 2012-10-23 22:51 -0700
  Re: turn list of letters into an array of integers Demian Brecht <demianbrecht@gmail.com> - 2012-10-23 22:54 -0700
  Re: turn list of letters into an array of integers Chris Rebert <clp2@rebertia.com> - 2012-10-23 23:07 -0700
    Re: turn list of letters into an array of integers 88888 Dihedral <dihedral88888@googlemail.com> - 2012-10-24 05:03 -0700
      Re: turn list of letters into an array of integers Robert Kern <robert.kern@gmail.com> - 2012-10-24 13:22 +0100
    Re: turn list of letters into an array of integers 88888 Dihedral <dihedral88888@googlemail.com> - 2012-10-24 05:03 -0700
    Re: turn list of letters into an array of integers seektime <michael.j.krause@gmail.com> - 2012-10-24 21:27 -0700
      Re: turn list of letters into an array of integers Chris Rebert <clp2@rebertia.com> - 2012-10-24 21:52 -0700
    Re: turn list of letters into an array of integers seektime <michael.j.krause@gmail.com> - 2012-10-24 21:27 -0700
  Re: turn list of letters into an array of integers Peter Otten <__peter__@web.de> - 2012-10-24 09:47 +0200
  Re: turn list of letters into an array of integers Peter Otten <__peter__@web.de> - 2012-10-24 11:04 +0200
  Re: turn list of letters into an array of integers Terry Reedy <tjreedy@udel.edu> - 2012-10-24 11:56 -0400
  Re: turn list of letters into an array of integers MRAB <python@mrabarnett.plus.com> - 2012-10-24 18:05 +0100
  Re: turn list of letters into an array of integers wxjmfauth@gmail.com - 2012-10-24 10:27 -0700
    Re: turn list of letters into an array of integers Demian Brecht <demianbrecht@gmail.com> - 2012-10-24 10:36 -0700
  Re: turn list of letters into an array of integers Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-24 15:57 -0400
  [OT] Re: turn list of letters into an array of integers Peter Otten <__peter__@web.de> - 2012-10-25 07:47 +0200
    Re: [OT] Re: turn list of letters into an array of integers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-25 07:49 +0000
      Re: [OT] Re: turn list of letters into an array of integers Peter Otten <__peter__@web.de> - 2012-10-25 10:25 +0200
      Re: [OT] Re: turn list of letters into an array of integers Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-25 09:55 +0100
  RE: turn list of letters into an array of integers "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-25 21:27 +0000

csiph-web