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


Groups > comp.lang.python > #27678 > unrolled thread

Re: writelines puzzle

Started by"William R. Wing (Bill Wing)" <wrw@mac.com>
First post2012-08-22 14:36 -0400
Last post2012-08-22 14:36 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: writelines puzzle "William R. Wing (Bill Wing)" <wrw@mac.com> - 2012-08-22 14:36 -0400

#27678 — Re: writelines puzzle

From"William R. Wing (Bill Wing)" <wrw@mac.com>
Date2012-08-22 14:36 -0400
SubjectRe: writelines puzzle
Message-ID<mailman.3683.1345664205.4697.python-list@python.org>
On Aug 22, 2012, at 1:28 PM, Jerry Hill <malaclypse2@gmail.com> wrote:

> On Wed, Aug 22, 2012 at 11:38 AM, William R. Wing (Bill Wing)
> <wrw@mac.com> wrote:
>> Much to my surprise, when I looked at the output file, it only contained 160 characters.  Catting produces:
>> 
>> StraylightPro:Logs wrw$ cat RTT_monitor.dat
>> 2354[ 734716.72185185  734716.72233796  734716.72445602 ...,  734737.4440162
>>  734737.45097222  734737.45766204][ 240.    28.5   73.3 ...,   28.4   27.4   26.4]
> 
> If that's the full output, then my guess is that x_dates and y_rtt are
> not actual python lists.  I bet they are, in fact, numpy arrays and
> that the string representation of those arrays (what you're getting
> from str(x_dates), etc) include the '...' in the middle instead of the
> full contents.
> 
> Am I close?
> 
> -- 
> Jerry

Yes - bingo.  They are numpy arrays.  And that was the hint I needed to go look in the numpy docs.  Found numpy.set_printoptions(threshold='nan'), which has indeed allowed me to get all the data into the file.

I now see Peter Otten made the same suggestion.

Thanks to you both.

Bill

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web