Hello,
I have 4 lists: a, b, c and d
Out of this 4 lists I want to build a table (e.g. list of lists):
a|b|c|d
---------------------------
a1|b1|c1|d1
a1|b2| |d2
You see: the lists are not equally sized.
Is there a command which fills up the shorter lists with blanks?
Like an enhanced zip() command, maybe?
Regards
Florian Reiser
-- http://www.ra-bc.de
RA Unternehmensberatung
Führen durch präzise Daten 4 1669
Florian Reiser wrote: Hello,
I have 4 lists: a, b, c and d Out of this 4 lists I want to build a table (e.g. list of lists):
a|b|c|d --------------------------- a1|b1|c1|d1 a1|b2| |d2
You see: the lists are not equally sized. Is there a command which fills up the shorter lists with blanks? Like an enhanced zip() command, maybe?
map(None, list1, list2, list3) http://aspn.activestate.com/ASPN/Coo.../Recipe/410687
Florian Reiser wrote: I have 4 lists: a, b, c and d Out of this 4 lists I want to build a table (e.g. list of lists):
a|b|c|d --------------------------- a1|b1|c1|d1 a1|b2| |d2
You see: the lists are not equally sized. Is there a command which fills up the shorter lists with blanks? Like an enhanced zip() command, maybe?
like map(None, ...), perhaps ? a = "1234" b = "12" c = "123" d = "1234" zip(a, b, c, d)
[('1', '1', '1', '1'), ('2', '2', '2', '2')] map(None, a, b, c, d)
[('1', '1', '1', '1'), ('2', '2', '2', '2'), ('3', None, '3', '3'),
('4', None, None, '4')]
</F>
Florian Reiser wrote: Hello,
I have 4 lists: a, b, c and d Out of this 4 lists I want to build a table (e.g. list of lists):
a|b|c|d --------------------------- a1|b1|c1|d1 a1|b2| |d2
You see: the lists are not equally sized. Is there a command which fills up the shorter lists with blanks? Like an enhanced zip() command, maybe?
Regards Florian Reiser
I posted a function to do this back in January. See: http://groups.google.co.uk/group/com...d1541e632adfdd
Hello Gene,
a big THANKS for this tip. This is exactly what I was looking for.
Regards
Florian Reiser
"gene tani" <ge*******@gmail.com> schrieb im Newsbeitrag
news:11*********************@i39g2000cwa.googlegro ups.com... Florian Reiser wrote: Hello,
I have 4 lists: a, b, c and d Out of this 4 lists I want to build a table (e.g. list of lists):
a|b|c|d --------------------------- a1|b1|c1|d1 a1|b2| |d2
You see: the lists are not equally sized. Is there a command which fills up the shorter lists with blanks? Like an enhanced zip() command, maybe?
map(None, list1, list2, list3)
http://aspn.activestate.com/ASPN/Coo.../Recipe/410687 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Matt Gerrans |
last post by:
This is probably so easy that I'll be embarrassed by the answer. While
enhancing and refactoring some old code, I was just changing some map()s to
list comprehensions, but I couldn't see any easy...
|
by: Charles Parker |
last post by:
Does MySQL have support for calling functions in C/C++ DLLs from trigger
scripts similar to the Extended Stored Procedures functionality provided in
SQL Sever? Thanks.
Charles...
--
MySQL...
|
by: WangKhar |
last post by:
Hi
(sorry this has turned into a bit of an epic...thought I'd as the
experts!)
SQL 2k, sp3a. Dual xeon 2.4. 2 gig ram. everything on a 3 disk raid 5.
Microsoft SQL Server 2000 - 8.00.760...
|
by: Istvan Albert |
last post by:
Hello all,
I've been debugging the reason for a major slowdown in a piece of
code ... and it turns out that it was the zip function. In the past
the lists that were zipped were reasonably short,...
|
by: igor.tatarinov |
last post by:
Given a bunch of arrays, if I want to create tuples, there is
zip(arrays). What if I want to do the opposite: break a tuple up and
append the values to given arrays:
map(append, arrays, tupl)...
| |
by: n8kindt |
last post by:
most areas on the east coast have zip codes starting with 0... you can probably see where i'm going with this already.
i'm trying to relate these 2 databses:
1) TaxDB - an ODBC MySQL database...
|
by: brandon |
last post by:
I know this thread is old but I found a great website for inexpensive
developer and marketing lists for zip codes. Plus they give free
updates.
http://www.listfactor.com
They have lists for...
|
by: moogyd |
last post by:
Hi group,
I have a basic question on the zip built in function.
I am writing a simple text file comparison script, that compares line
by line and character by character. The output is the...
|
by: dontcare |
last post by:
The Java version of extended VTD-XmL is released and available for
download.
This version supports 256 GB max file sizes and memory mapped
capabilities.
The updated documentation is also...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |