Coder Social home page Coder Social logo

Comments (5)

davidagold avatar davidagold commented on May 18, 2024

@bramtayl Have you made sure that you're using the DataFramesMeta package as well as the DataFrames package? @based_on lives in the former. Perhaps a little confusing. You can add the former package by callingPkg.add("DataFramesMeta")`.

from dataframesmeta.jl.

bramtayl avatar bramtayl commented on May 18, 2024

Yes. I checked the source for DataFramesMeta.@based_on, below.

macro based_on(x, args...)
  esc(:( DataFrames.based_on($x, _DF -> DataFramesMeta.@with(_DF, DataFrames.DataFrame($(args...)))) ))
end

However, it looks like DataFrames.based_on has been depreciated as of 0.5.2:

Removes expression-based indexing, including with, within!, based_on, etc.

from dataframesmeta.jl.

davidagold avatar davidagold commented on May 18, 2024

Ah, I totally misunderstood your question! I apologize. Are you looking for a way to produce something like:

3x2 DataFrame
| Row | Species      | mean_petal_length |
|-----|--------------|-------------------|
| 1   | "setosa"     | 1.462             |
| 2   | "versicolor" | 4.26              |
| 3   | "virginica"  | 5.552             |

?

from dataframesmeta.jl.

bramtayl avatar bramtayl commented on May 18, 2024

Yes, and since I've written my post I've realized this can by done with @by.

from dataframesmeta.jl.

davidagold avatar davidagold commented on May 18, 2024

Indeed. Glad to hear. (Also, it's good to wrap macro names in ` s so as not to tag users with the same username as the macro name.)

from dataframesmeta.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.