You're creating a Dataset with a list of lists of associations. What does it mean to create a Dataset with a list of list of associations? I don't know; that is kind of a funky structure. Creating a Dataset out of a list of list of associations doesn't magically remove (i.e., Flatten) that secondary structure. The entries in your Dataset are Associations. That makes no sense -- it doesn't make any sense to me. The Wolfram Language is rather promiscuous; it will let you do all sorts of things that might make no sense programatically.
That promiscuity extends to displaying dubious expressions: it tries the best it can. It looks like a simple Dataset, but using FullForm will show the whole structure:
listOfLists // Dataset // FullForm
A sane Dataset is created if you Flatten your list-of-lists input first:
listOfLists // Flatten // Dataset // FullForm
Run those 2 expressions and note that the output is dramatically different.
Anyone know what is causing the problem?
The fundamental problem is that you haven't ever specified what you're trying to do. It looks like you're trying to create a Dataset that has a two-level hierarchy with a list of games. Defining that as a list-of-list of associations appears to not work. Instead, you want to create a single list of associations, and have each of those associations have some structure within them.
I asked my friendly neighborhood AI how one would go about doing that:
how do you create a nested database in the Wolfram Language
It provided two examples. Here's the first:
data = {
<|"game" -> "Game 1",
"players" -> {
<|"name" -> "Alice", "score" -> 5|>,
<|"name" -> "Bob", "score" -> 7|>
}|>,
<|"game" -> "Game 2",
"players" -> {
<|"name" -> "Alice", "score" -> 8|>,
<|"name" -> "Charlie", "score" -> 6|>
}|>
};
dataset = Dataset[data]
I ran that. If you create that Dataset, you'll see the 2-level structure in place. Row and column selection should work just fine on that Dataset. The structure is created in each association, but only one simple list of those associations is passed to create the Dataset. I strongly recommend asking questions like this to ChatGPT; it has a great breadth of knowledge in the Wolfram Language. Just be a skeptic and double-check everything it gives you. Don't be thrown if ChatGPT gives you a slightly different response to the response I showed above. The reply that Chat gives to any question is influenced by the context of the earlier conversation. A poet might call that the butterfly effect of AIs: getting a different response when two questions appear to be identical.
@Jim Holtman, I think these are great explorations. EIWL gives a broad introduction to the language, but it doesn't go into great depth of any of them. You're exploring something beyond the flat Datasets that were shown in the book and course. I definitely learned something by poking around with your question. I fondly hope my response was helpful.