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]}}

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105339] Re: How to make {f,g}[a,b,c] to become {{f[a],g[a]},{f[b],g[b]},{f[c],g[c]}}
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Sat, 28 Nov 2009 01:08:28 -0500 (EST)
  • References: <heoe15$4ph$1@smc.vnet.net>

Lawrence Teo schrieb:
> 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 doubt that, it rather looks like {{f,g}[a],{f,g}[b],...} to me...

> I need a way to
> 'distribute' the country name into the GDP and Population portion.
> 

Why don't you just do:

{CountryData[#, "GDP"], CountryData[#, "Population"]} & /@
 CountryData[]

in the first place?

hth,

albert


  • 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: ListPointPlot3D - how to join points
  • 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]}}