Re: Replace
- To: mathgroup at smc.vnet.net
- Subject: [mg121074] Re: Replace
- From: "Hans Michel" <hmichel at cox.net>
- Date: Fri, 26 Aug 2011 05:23:53 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201108251106.HAA24963@smc.vnet.net>
Sam
I don't believe you want to replace but you may want to transform your List
into another form for presentation.
You may want to try the following.
data = Table[{i, Random[Integer, {0, 30}]}, {i, 1, 10}];
mform[x_List] :=
MatrixForm[{x[[2]]}, TableHeadings -> {{ToString[x[[1]]]}, None} ];
Map[mform, data]
The output may visually meet your requirement, but the underlying structure
is a list of MatrixForm elements.
If you are exporting that result this may not be what you want.
Hans
-----Original Message-----
From: Sam Korn [mailto:sam at kornfamily.com]
Sent: Thursday, August 25, 2011 6:07 AM
To: mathgroup at smc.vnet.net
Subject: [mg121074] Replace
Hi, another stupid question. I have a list, and each element in the list is
a sublist with a pair of integers. How do I replace each element along the
lines of "{5,6}" with "(5|6)"?
I know it's a stupid question, and there's probably something really obvious
I'm missing, but I'm really new to Mathematica.
Thanks!
-Sam
- References:
- Replace
- From: Sam Korn <sam@kornfamily.com>
- Replace