data=Dataset<|"black"-><|"birthplace"->,""->2,"z"->3|>,"b"-><|"x"->5,"y"->10,"z"->7|>|>
data=Dataset5"race""black","birthplace",6"race""black","birthplace",1"race""black","birthplace",2"race""black","birthplace",3"race""black","birthplace",4"race""black","birthplace",7"race""white","birthplace",8"race""white","birthplace",9"race""white","birthplace",10"race""white","birthplace",11"race""white","birthplace",12"race""white","birthplace"
Out[]=
In[]:=
Normal[data]
Out[]=
5raceblack,birthplace,6raceblack,birthplace,1raceblack,birthplace,2raceblack,birthplace,3raceblack,birthplace,4raceblack,birthplace,7racewhite,birthplace,8racewhite,birthplace,9racewhite,birthplace,10racewhite,birthplace,11racewhite,birthplace,12racewhite,birthplace
In[]:=
data[5,"race"]
Out[]=
black
In[]:=
data[5]["race"]
Out[]=
black
In[]:=
Query[5,"race"][data]
Out[]=
black
In[]:=
Query[5][data]
Out[]=
In[]:=
Query[All,"race"][data]
Out[]=
In[]:=
Query[All,"birthplace"][data]
Out[]=
In[]:=
Query[f][data]
Out[]=
f5raceblack,birthplace,6raceblack,birthplace,1raceblack,birthplace,2raceblack,birthplace,3raceblack,birthplace,4raceblack,birthplace,7racewhite,birthplace,8racewhite,birthplace,9racewhite,birthplace,10racewhite,birthplace,11racewhite,birthplace,12racewhite,birthplace
In[]:=
transposeddata=Dataset[AssociationTranspose[Normal[data]]]
Out[]=
I want to use Count(*) to get this like in SQL you have Select count(*) from data where <clause>.
I then want to order this.
This makes it easy to see which combination of race and birth place has the most people. For example, what birthplace for white people was the most common is easy to answer by looking at this dataset.