Article View: pl.comp.lang.python
Article #27845Re: Obcięcie w tablicy NumPy początkowych wartości poniżej pewnego poziomu
From: Karol
Date: Thu, 09 Dec 2010 18:15
Date: Thu, 09 Dec 2010 18:15
14 lines
1499 bytes
1499 bytes
Możesz tę pętle zakończyć po znalezieniu odpowiedniego indeksu:
def trim_input(data, threshold):
start = 0
for d in data:
if np.abs(d) < threshold:
start = start + 1
else:
break
return data[start:]
- Karol
Technical Details
Message-ID:
<0826500c-5e6e-4e60-968b-c0a2a1e8f3dd@j29g2000yqm.googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!j29g2000yqm.googlegroups.com!not-for-mailReferences:
<4d00e457$0$27028$65785112@news.neostrada.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!news.glorb.com!postnews.google.com!j29g2000yqm.googlegroups.com!not-for-mail From: Karol <karol.langner@gmail.com> Newsgroups: pl.comp.lang.python Subject: Re: Obcięcie w tablicy NumPy początkowych wartości poniżej pewnego poziomu Date: Thu, 9 Dec 2010 10:15:53 -0800 (PST) Organization: http://groups.google.com Lines: 14 Message-ID: <0826500c-5e6e-4e60-968b-c0a2a1e8f3dd@j29g2000yqm.googlegroups.com> References: <4d00e457$0$27028$65785112@news.neostrada.pl> NNTP-Posting-Host: 132.229.116.21 Mime-Version: 1.0 X-Trace: posting.google.com 1291918553 6755 127.0.0.1 (9 Dec 2010 18:15:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 9 Dec 2010 18:15:53 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j29g2000yqm.googlegroups.com; posting-host=132.229.116.21; posting-account=5h39qQoAAAABFtP60-XvoRftg8vaJb5- User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101028 Iceweasel/3.5.15 (like Firefox/3.5.15),gzip(gfe) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit