Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct way to reference a column name in a dataframe with Query _.b vs :b? #331

Open
rleyvasal opened this issue Aug 19, 2021 · 0 comments

Comments

@rleyvasal
Copy link

Looking at the Query getting started page I came across two different ways to reference column names in a data frame.

I want to know what is the correct way to reference a column in a dataframe and why there is an inconsistency in referencing column names.

_.b

using Query, DataFrames, Statistics
df = DataFrame(a=[1,1,2,3], b=[4,5,6,8])
df2 = df |>
    @groupby(_.a) |>
    @map({a=key(_), b=mean(_.b)}) |>
    @filter(_.b > 5) |>
    @orderby_descending(_.b) |>
    DataFrame

:b

df = DataFrame(a=[1,2,3], b=[4,missing,5])

q = df |> @dropna(:b) |> DataFrame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant