Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.079 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'mask': 0.09; 'python': 0.11; 'numpy': 0.16; 'right:': 0.16; 'think?': 0.16; 'wrote:': 0.18; 'wed,': 0.18; '>>>': 0.22; 'import': 0.22; 'header:In-Reply- To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '>>>>': 0.31; 'george': 0.31; 'linux': 0.33; 'received:google.com': 0.35; 'hat': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'more': 0.64; 'default': 0.69; 'jul': 0.74; '2014,': 0.84; 'trojan': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ptaT2k/MDhANgQ5vyzUJV5moqBf+HgBIV6KKOXa87sI=; b=OtSkKuYiIx6WzUzThtK6jr2eixSXxOhKP9kfCY9pYAkiYCiC1DTCF5gU+8LSieTOCK QoY/4LKXGgJ0kfxEeHEHw1w1/3y9Imy6mJ0udy4m7MEvC4C4UXVggR5cj+8PHTgxnaXi xYFshPiIaEu2H2Wu8rGEl1CEwfDCr7muSkt9vAVD8jfwrbKYAasG5BKVmx5jHjoPq8XM /U0QBN12hrC9PVz0V7ZplY3fVXIagP7PRqZ9RA7XBZ9YlAW5mSXQAjWuiuRIelMuPCOC PHaQPPaU6ZasFgT/uBYkH2TlbiYEyez5yNoUwa4Ovb/5WZlS0EhL/TkqFTCAM+cQJkoI nDQQ== X-Received: by 10.66.141.77 with SMTP id rm13mr13033956pab.91.1412796012212; Wed, 08 Oct 2014 12:20:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <5435665D.5010902@noaa.gov> References: <5435665D.5010902@noaa.gov> From: Ian Kelly Date: Wed, 8 Oct 2014 13:19:32 -0600 Subject: Re: strange numpy behaviour To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1412796015 news.xs4all.nl 2937 [2001:888:2000:d::a6]:35945 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:78847 On Wed, Oct 8, 2014 at 10:29 AM, George Trojan wrote: > This does not look right: > > dilbert@gtrojan> python3.4 > Python 3.4.1 (default, Jul 7 2014, 15:47:25) > [GCC 4.8.3 20140624 (Red Hat 4.8.3-1)] on linux > Type "help", "copyright", "credits" or "license" for more information. >>>> import numpy as np >>>> a=np.ma.array([0, 1], dtype=np.int8, mask=[1, 0]) >>>> a > masked_array(data = [-- 1], > mask = [ True False], > fill_value = 999999) > >>>> a.data > array([0, 1], dtype=int8) >>>> a.filled() > array([63, 1], dtype=int8) <------- Why 63? >>>> > > What do you think? The datatype is int8, the fill value is the default of 999999, and 999999 & 0xff == 63.