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


Groups > comp.lang.python > #35704

Re: Wrapping statements in Python in SPSS

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.nosignal.org!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.011
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'subject:Python': 0.05; 'wrapped': 0.07; 'python': 0.09; 'length.': 0.09; 'variables,': 0.09; 'dec': 0.15; 'sat,': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'looping': 0.16; 'presume': 0.16; 'wrote:': 0.17; 'variables': 0.17; 'statement': 0.23; 'idea': 0.24; 'pass': 0.25; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'loop,': 0.29; 'strings,': 0.29; 'wrap': 0.29; 'function': 0.30; 'error': 0.30; 'lists': 0.31; 'point': 0.31; 'getting': 0.33; 'safely': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'really': 0.36; 'but': 0.36; 'anything': 0.36; 'too': 0.36; 'skip:z 10': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'short': 0.39; 'header:Received:5': 0.40; 'more': 0.63; 'show': 0.63; 'within': 0.64; 'making': 0.64; 'here': 0.65; 'imagine': 0.96
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=BeUn4G/HuHzKqMvTWDgBE7kJL1EU3tMuoAD3d3aaxiQ=; b=dmBstGtJ9fL8sXvT2YL++i2rxG6qFrjNcqVQTZaBA8DDu/115HcVM1rkBlAOuupoxq evktzJkyyO8qQyWgNL+pN8HjhAqoPs4/Nd4eOZ/Tg87Jt/6I/wQJ6HjuYTWrdw1Lxwlm Obf/XyPGpSf8QSeeCBw/UcVOlsFLKBZTV1mFaj+DJAhtypj7gph3+4ZpEEf5kvXu2QQ6 ItvY7QEr/29USZTEnYQYAuxDg3xkbsE2CN/TX4NkZTFyhujJo015ZSUpkLdelfm5NjAe rAOsn61Fct2PGvIp/jlAYEAZZhohZcwxbZz03Me0jiGaiIEatSdh5mqKKlxxTV2huqNs Bz5g==
MIME-Version 1.0
In-Reply-To <7fcd8949-c781-425c-b6d2-7d0a634b12b7@googlegroups.com>
References <7fcd8949-c781-425c-b6d2-7d0a634b12b7@googlegroups.com>
Date Sat, 29 Dec 2012 03:10:10 +1100
Subject Re: Wrapping statements in Python in SPSS
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
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.1397.1356711013.29569.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1356711013 news.xs4all.nl 6885 [2001:888:2000:d::a6]:41330
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:35704

Show key headers only | View raw


On Sat, Dec 29, 2012 at 3:01 AM,  <alankrinsky@gmail.com> wrote:
> I am working with Python looping in SPSS. What are the limits for the
>
> for var1, var2, var3 in zip(Variable1, Variable2, Variable3):
>
> statement in the Python looping function within SPSS? I am getting an error message, I presume because of wrapping or length. Imagine the above statement, but expanded, as I am working with more than 28 variables in this loop, and even making the names really short is making the statement too long. Is it impossible to wrap and make this work? I know there are ways to wrap strings, including lists of variables, but here I have a statement/function.

At what point are you wrapping it? Can you show the wrapped form and
the error message?

As a general rule, you can safely wrap anything that's inside parentheses.

for (
  var1,
  var2,
  var3
) in zip(
  Variable1,
  Variable2,
  Variable3
):
  pass

That may be a tad excessive, but you get the idea :)

ChrisA

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


Thread

Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 08:01 -0800
  Re: Wrapping statements in Python in SPSS Chris Angelico <rosuav@gmail.com> - 2012-12-29 03:10 +1100
    Re: Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 08:43 -0800
      Re: Wrapping statements in Python in SPSS Peter Otten <__peter__@web.de> - 2012-12-28 18:07 +0100
      Re: Wrapping statements in Python in SPSS Chris Angelico <rosuav@gmail.com> - 2012-12-29 04:12 +1100
        Re: Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 09:33 -0800
          Re: Wrapping statements in Python in SPSS Mitya Sirenef <msirenef@lightbird.net> - 2012-12-28 12:55 -0500
          Re: Wrapping statements in Python in SPSS Mitya Sirenef <msirenef@lightbird.net> - 2012-12-28 13:05 -0500
          Re: Wrapping statements in Python in SPSS Mitya Sirenef <msirenef@lightbird.net> - 2012-12-28 13:20 -0500
        Re: Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 09:33 -0800
    Re: Wrapping statements in Python in SPSS alankrinsky@gmail.com - 2012-12-28 08:43 -0800

csiph-web