Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoudbuzing committed Dec 11, 2017
1 parent 17ad823 commit f1380c8
Show file tree
Hide file tree
Showing 2 changed files with 483 additions and 418 deletions.
9 changes: 9 additions & 0 deletions Prototypes/Prototypes.wl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ StandardDeviationBy::usage = "StandardDeviationBy[data, func] computes the stand
MedianBy::usage = "MedianBy[data, func] computes the median of 'data' by using 'func'"
VarianceBy::usage = "VarianceBy[data, func] computes the variance of 'data' by using 'func'"
CommonestBy::usage = "CommonestBy[data, func] computes the commonest value of 'data' by using 'func'"
MinBy::usage = "MinBy[data, func] computes the minimum value of 'data' by using 'func'"
MaxBy::usage = "MaxBy[data, func] computes the maximum value of 'data' by using 'func'"
RarestBy::usage = "RarestBy[data, func] computes the rarest (least common) values of 'data' by using 'func'"

Rarest::usage = "Rarest[data] computes the rarest (least common) values of 'data'"

(* data science *)

Expand Down Expand Up @@ -108,7 +113,11 @@ MedianBy[ data_, func_ ] := By[ Median, data, func]
StandardDeviationBy[ data_, func_ ] := By[ StandardDeviation, data, func ]
VarianceBy[ data_, func_ ] := By[ Variance, data, func ]
CommonestBy[ data_, func_ ] := By[ Commonest, data, func ]
MaxBy[ data_, func_ ] := By[ Max, data, func ]
MinBy[ data_, func_ ] := By[ Min, data, func ]

Rarest[ data_ ] := Flatten[Take[MinimalBy[Tally[data], Last], All, 1]]
RarestBy[ data_, func_ ] := By[ Rarest, data, func]

(* dataset extensions *)

Expand Down
Loading

0 comments on commit f1380c8

Please sign in to comment.