You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason why this is not allowed is that gdf[1] would be ambiguous as it could mean:
Selecting the first group.
Selecting the group with key equal to 1.
In the past we discussed allowing gdf(1) (and by extension e.g. gdf(1,2,3) for multiple grouping keys) to make this case easier, but it did not get much support. But maybe we can reconsider it.
Ahh.. I can see the challenge. DimensionalData.jl uses At(1)... such that gdf[1] is the first group and gdf[At(1)] is the group with key value of 1... though I'm not sure how simpatico that is with DataFrames
We could use At (or other such wrapper), but in this case it is longer to write At(1) than (1,). And this was a consideration why we did not introduce it yet.
Thinking about this more gdf[At("Berlin")] produces more readable/understandable code as it retains the indexing brackets [] and then specifies what is being requested. gdf("Berlin") might be a bit ambiguous as it suggests a function call.
#Make example grouped data frame
this is how the data frame needs to be accessed now:
for a data frame grouped by a single attribute it would be more intuitive to simply index in the same was as a data frame column
The text was updated successfully, but these errors were encountered: