Select SubdataFrame in groupDataFrame by symbol


I haven’t found the way to select a specific SubDataFrame in a Grouped DataFrame.
Let’s say you have the following dataframe

df = DataFrame(A = rand(5), B = ["type1", "type2", "type1", "Type3", "type2"])

that you group by with column B

dfg = groupby(df,:B)

If you want to acces to one subdataFrame you can use indexing


But without checking the value in dfg[1] of column B, you don’t know which one is it…
Is there a way to say I want the subdataFrame corresponding to B = “type2” ? Something like

dfg[B = "type2"]

or directly


Thanks for your help.