I have a 2-dim array. The first 3 rows have column headings. The heading can be a single word, or 2 words (which take 2 rows) or 3 words (which take 3 rows). For each column I know which row has the most meaningful name for that column. I can't figure out how to map this and get what I want. For example:
a1 = {{"", "", "Class"}, {"Year", "Full", "of"}, {"Sold", "Amount", "business"}}; a2 = {2, 3, 1}; I want my three headings to be "Year", "Amount", "Class", this is based on a2. I assume I can use Part to do this, and use Map with a LevelSpec. But I can't figure out how to make this work. Maybe I'm thinking in the wrong direction.