As you can see from the picture, I want to change the keys names of the list. There are 14314 keys names, but they are all mess, I want to change it with a list of continuous numbers like Range[14314]. But I don't know how to do it.
1 Answer
$\begingroup$ $\endgroup$
1 As an example, we'll use the built-in Titanic dataset
f = ExampleData[{"Dataset", "Titanic"}][GroupBy["class"]]; A Dataset can be converted to an an Association/List form by using the Normal function, e.g.,
Normal[f] What you want to do is replace the keys and re-convert this into a Dataset, which is easily accomplished by:
With[ {values = Values@Normal[f], newGroups = Range@Length[f] }, Dataset@AssociationThread[newGroups, values]] - $\begingroup$ Thank you very much for helping me solve the problem Mr Schrier! $\endgroup$Liming Zhou– Liming Zhou2021-03-20 05:13:39 +00:00Commented Mar 20, 2021 at 5:13

![output of Normal[f]](https://i.sstatic.net/bFP1J.png)
