nilshg / TreatmentPanels.jl

Utilities for turning DataFrames into panel-like data structures for use in causal inference models
MIT License
4 stars 2 forks source link

Building a Generic Panel Data Interface #6

Open ParadaCarleton opened 2 years ago

ParadaCarleton commented 2 years ago

Some things that might be necessary for a generic panel data interface:

@bkamins

bkamins commented 2 years ago

All these functionalities seem to be better placed in TreatmentPanels.jl as (at least currently) I do not see anything that requires changes in DataFrames.jl (but I might be wrong - let us see how the thread evolves).

ParadaCarleton commented 2 years ago

All these functionalities seem to be better placed in TreatmentPanels.jl as (at least currently) I do not see anything that requires changes in DataFrames.jl (but I might be wrong - let us see how the thread evolves).

I actually agree. In fact, I think DataFrames.jl already mostly implements everything we'd need. The only thing I think would be good to add in DataFrames.jl is a constructor taking a grouped DataFrame where one of the columns is a date.

bkamins commented 2 years ago

a constructor taking a grouped DataFrame where one of the columns is a date.

What output would you expect then? DataFrame constructor already accepts GroupedDataFrame as an argument.

ParadaCarleton commented 2 years ago

a constructor taking a grouped DataFrame where one of the columns is a date.

What output would you expect then? DataFrame constructor already accepts GroupedDataFrame as an argument.

It'd output a Panel/TreatmentPanel, preferably without copying the underlying data -- I assume it should be possible to allow for an arbitrary underlying data source using the Table interface and something like MLUtils.