MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to make {f,g}[a,b,c] to become

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105336] Re: [mg105301] How to make {f,g}[a,b,c] to become
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 28 Nov 2009 01:07:54 -0500 (EST)
  • Reply-to: hanlonr at cox.net

Outer[#2[#1] &, {a, b, c}, {f, g}]

{{f[a], g[a]}, {f[b], g[b]}, {f[c], g[c]}}

Outer[CountryData[#1, #2] &, CountryData[],
  {"Name", "GDP", 
   "Population"}] ==
 ({CountryData[#, "Name"], 
     CountryData[#, "GDP"],
     CountryData[#, "Population"]} & /@ CountryData[])

True


Bob Hanlon

---- Lawrence Teo <lawrenceteo at yahoo.com> wrote: 

=============
I have a question. How to make {f,g}[a,b,c] to become {{f[a],g[a]},{f
[b],g[b]},{f[c],g[c]}}?

I want to do {GPD, Population} for all countries.

Something similar to the following...
{CountryData[#, "GDP"] &, CountryData[#, "Population"] &} /@
 CountryData[]

It ends up in the form of {f,g}[a,b,c,d,...]. I need a way to
'distribute' the country name into the GDP and Population portion.

Thanks.




  • Prev by Date: Re: RevolutionPlot3D: Specifying the axis of rotation
  • Next by Date: Re: How to make {f,g}[a,b,c] to become
  • Previous by thread: Re: ListPointPlot3D - how to join points
  • Next by thread: Re: How to make {f,g}[a,b,c] to become