MathGroup Archive 2009

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

Search the Archive

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


Map[  Through , Outer[  {f,g} , {a,b,c}  ]  ]

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



On Nov 27, 10:43 pm, Lawrence Teo <lawrence... 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: How to make {f,g}[a,b,c] to become {{f[a],g[a]},{f[b],g[b]},{f[c],g[c]}}
  • Next by Date: Re: How to make {f,g}[a,b,c] to become {{f[a],g[a]},{f[b],g[b]},{f[c],g[c]}}
  • Previous by thread: Re: How to make {f,g}[a,b,c] to become {{f[a],g[a]},{f[b],g[b]},{f[c],g[c]}}
  • Next by thread: Re: How to make {f,g}[a,b,c] to become {{f[a],g[a]},{f[b],g[b]},{f[c],g[c]}}