Re: Re: Copy and Pasting Tables into Spreadsheet
- To: mathgroup at smc.vnet.net
- Subject: [mg83487] Re: [mg83416] Re: Copy and Pasting Tables into Spreadsheet
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Wed, 21 Nov 2007 03:00:23 -0500 (EST)
- References: <fhp2jd$1q6$1@smc.vnet.net> <21023874.1195600227033.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
You're apparently using a different language than the rest of us:
prob = {.4, .6};
prob[[1]]
prob[[2]]
0.4
0.6
No List output there!
However, if prob[[1]] IS a list for whatever reason, then fix it with a
rule:
prob[[1]] /. {{x_} :> x}
Bobby
On Tue, 20 Nov 2007 02:45:15 -0600, <gregory.lypny at videotron.ca> wrote:
> Thank you for the tip, Bill.
>
> Probably my inexperience, but it still seems like a lot of bother. If
> something displays as two dimensional (R rows, C columns) when using
> TableForm, it seems to me that you should be able to cut and paste it
> as such for other applications, despite keeping its greater depth
> within Mathematica.
>
> I found the source of the problem in my case. I use two
> probabilities, prob = {.4, .6}, in my calculations to make the
> tables. The problem arises because prob[[1]] returns {.4} rather than
> the simple scalar, .4, and prob[[2]] returns {.6} rather than .6, in
> other words, lists with one element each. Now I know that this is
> what Mathematica is supposed to do: return a list when given a list to
> process. If I redo my tables using scalars, prob1=.4 and prob2 = .6,
> there is no more problem with depth. Is there a way to tell
> Mathematica to return a scalar in all situations when the result would
> otherwise be a list with only one element?
>
> Regards,
>
>
>
>
--
DrMajorBob at bigfoot.com