[Numpy-discussion] Overlap arrays with "transparency"
Wed May 20 08:24:33 CDT 2009
On Wed, May 20, 2009 at 7:24 AM, Cristi Constantin <firstname.lastname@example.org> wrote:
> Thank you for your help. :)
> I used this :
> try: NData[ (NData==transparent)[:len(OData)] ] = OData[ (NData==transparent)[:len(OData)] ]
> except: pass
> That means overwrite all "transparent" data from NData with valid data from
> I am sure it's not the best method yet, but it's the only one that works.
just some quick comments:
If you assign (NData==transparent)[:len(OData)] to a temporary
variable, then you don't need to calculate this twice.
It would save a bit of time.
Catching all exceptions with ``except: pass`` is definitely discouraged.
More information about the Numpy-discussion