tidypyverse / tidypandas

A grammar of data manipulation for pandas inspired by tidyverse
https://tidypyverse.github.io/tidypandas/
MIT License
91 stars 7 forks source link

[TODO] Implement `expand` and `complete` #10

Closed talegari closed 2 years ago

talegari commented 2 years ago

https://tidyr.tidyverse.org/reference/complete.html https://tidyr.tidyverse.org/reference/expand.html

talegari commented 2 years ago

ideas: nesting(a, b) --> df.distinct(['a', 'b']) nesting(nesting(a, b), c) ==?nesting(a, b, c)

crossing(a, b) --> df.distinct'a').cross_join(df.distinct('b')) crossing(crossing(a, b), c) == crossing(a, b, c)

nesting -- ( crossing -- [

expand( [a, (b, [c, d])] )

  1. recursion
  2. tree parsing
talegari commented 2 years ago

https://github.com/talegari/tidypandas/commit/837d5f56fe1e452073f538131fa38918ef6360be