Article View: pl.comp.lang.python
Article #27842Re: 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
1500 bytes
1500 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:
<e5dbd928-5ef1-4914-9e92-f04c63339398@c39g2000yqi.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!c39g2000yqi.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!c39g2000yqi.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:45 -0800 (PST) Organization: http://groups.google.com Lines: 14 Message-ID: <e5dbd928-5ef1-4914-9e92-f04c63339398@c39g2000yqi.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 1291918545 12713 127.0.0.1 (9 Dec 2010 18:15:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 9 Dec 2010 18:15:45 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c39g2000yqi.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