473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

pretty print 2D arrays

I figure someone must have done this nicely but
I can't find it. I'd like structured printing of 2D
arrays, where an entry of None or '' should be
printed as whitespace. Something like:

Inputs: 2D array, 1D array of fixed field widths, 1D array of format
suggestions
Effect: formatted print of the 2D array (or its transpose)

Thanks,
Alan Isaac
Jul 18 '05 #1
1 4481


Alan G Isaac wrote:
I figure someone must have done this nicely but
I can't find it. I'd like structured printing of 2D
arrays, where an entry of None or '' should be
printed as whitespace. Something like:

Inputs: 2D array, 1D array of fixed field widths, 1D array of format
suggestions
Effect: formatted print of the 2D array (or its transpose)

Thanks,
Alan Isaac

You might consider numarray, but you would have to make your own
provision for Null entries.

Colin W.

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy Fish | last post by:
Hi, I am trying to use MXXMLWriter with the indent flag to pretty print an XML document from vb6. Although the output is mostly indented in a reasonable way, the end tags are always bunched...
8
by: Ronen Kfir | last post by:
I need to take as an input matrix N*M from stdin & print it as a matrix shape, something like: |6 8 2 4 7| |4 0 1 8 2| |3 1 5 2 6| |9 3 8 4 0| I don't have any idea how...
29
by: JS | last post by:
I would like to print char 'd': main(){ char g; g = 'a'; g = 'b'; g = 'c'; g = 'd';
2
by: Martin | last post by:
I have encountered a bug in print preview: In my program, data for printing is taken from arrays. When print preview is invoked or page is printed directly, it is ok, but when user prints from...
2
by: akbar | last post by:
Hi, I have Document. If I print it like this: print doc.toprettyxml(" ") I will get this: <a> <b> <c>
7
by: pauld | last post by:
Ive got a series of 2 dimensional associative arrays while(list($key, $val) = each ($results)) { {foreach($val as $i=>$v) print "$i = $v"; } } but i want to define the order that the...
9
by: Chad | last post by:
The input file is: Params 1 2 3 4 5 6,7 Data 1,1
8
by: Grant Edwards | last post by:
How do you print a numpy array? I tried the obvious print a, print `a`, and print str(a), but none of them work on anything other than trivially small arrays. Most of my real data is elided and...
2
Blackout
by: Blackout | last post by:
Hi, I'm having problems with this C program. Whenever I run it, it doesn't print anything. The program is supposed to compute and display all the prime numbers from 1 - 300 using the sieve of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.