Tag Info

New answers tagged

9

Preamble This is a very good question, because answering it will make it very clear what immutability means, both in general and in the context of Associations. General A few general words on immutability Associations are immutable data structures. This means that they carry no state, and a copy of an Association is another completely independent ...


0

Would this work for you? Using Map twice feels like the most intuitive approach to me. listCountries = {"United States", "Mexico", "Canada"}; data = {"GDP", "ExternalDebt"}; Function[{country}, CountryData[country, #] & /@ data] /@ listCountries If you want to display the country next to its data, just modify your Function to include that ...


3

Consider these two lists: listCountries = { "Bangladesh", "India", "Monaco" }; data = { "GDP", "Population", "Area" }; There are two cases: you want the GDP, population and area of each country in the first list. The most elegant solution I can think of is Outer: Outer[CountryData, listCountries, data] The other is that you ...


7

If you look at SystemOptions[], like so, Column[ OpenerView /@ (Replace[SystemOptions[], Rule[x_, y_] -> List[x, y], 1]) ] you see that under CompileOptions, if you click on the triangle to open it, there is an option "MapCompileLength" -> 100. Set it to eg 10 and see it it helps (do SetSystemOptions["CompileOptions" -> ...



Top 50 recent answers are included