Skip to content

Allow Python values directly #51

Description

@drhagen

There should be a way to provide values directly to mutate, transmute, and summarize. For example, you can currently write DataFrame(x=[1,2,3]).mutate(y="5") to add a column of all 5s. If the value is in a variable, then you have to DataFrame(x=[1,2,3]).mutate(y=f"{variable}"), which is awkward.

We cannot simply allow values to be passed into the existing methods because there would be a type instability when providing a string. Here are some possible syntaxes:

  1. val function. df.mutate(y=val(variable))
  2. Append underscore. df.mutate_(y=variable)
  3. Normal name. df.mutate_values(y=variable)

The advantage of val is that it can be provided at the same time are parsed expressions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions