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.