Skip to content

[DF] Add convenience function to describe the dataframe #7561

@stwunsch

Description

@stwunsch

Edit: I'll post the newest version always at the bottom of the feed. The interface here at the top is not state-of-the-art!


I've created this issue to discuss how the feature should look like, see the attached PR for the impl.

My current interface looks as follows:

import ROOT

df = ROOT.RDataFrame(1)\
         .Define('myInt', 'int(1)')\
         .Define('myFloat', 'float(1)')\
         .Define('myVec', 'ROOT::RVec<float>({1, 2, 3})')

print(df.GetSchema())
# Prints you this:
'''
Column  Type
------  ----
myInt   int
myFloat float
myVec   ROOT::VecOps::RVec<float>
'''
  • Do we like the name of the function? Describe is better
  • Do we like that it returns a string rather than printing to stdout? We like strings!
  • Should we add a header to the table? Edit: Done, see above!
  • Should we add any other information (see TTree::Print)? Yes, see below

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions