NamedTupleIteratorExtensions
io.github.quafadas.scautable.NamedTupleIteratorExtensions
object NamedTupleIteratorExtensions
Attributes
- Experimental
- true
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
Members list
Value members
Concrete fields
Extensions
Extensions
extension [K <: Tuple, V <: Tuple](itr: Iterator[NamedTuple[K, V]])
inline def addColumn[S <: String, A](fct: NamedTuple[K, V] => A): Iterator[NamedTuple[Append[K, S], Append[V, A]]]
inline def column[S <: String](using ev: IsColumn[S, K] =:= true, s: ValueOf[S]): Iterator[GetTypeAtName[K, S, V]]
inline def columns[ST <: Tuple](using ev: AllAreColumns[ST, K] =:= true): Iterator[NamedTuple[SelectFromTuple[K, TupleContainsIdx[ST, K]], GetTypesAtNames[K, SelectFromTuple[K, TupleContainsIdx[ST, K]], V]]]
inline def dropColumn[S <: String](using ev: IsColumn[S, K] =:= true, s: ValueOf[S]): Iterator[NamedTuple[DropOneName[K, S], DropOneTypeAtName[K, S, V]]]
inline def forceColumnType[S <: String, A]: Iterator[NamedTuple[K, ReplaceOneTypeAtName[K, S, V, A]]]
inline def mapColumn[S <: String, A](using ev: IsColumn[S, K] =:= true, s: ValueOf[S])(fct: GetTypeAtName[K, S, V] => A): Iterator[NamedTuple[K, ReplaceOneTypeAtName[K, S, V, A]]]
inline def nonNumericCols: Iterator[NamedTuple[SelectFromTuple[K, TupleContainsIdx[SelectFromTuple[K, Negate[NumericColsIdx[V]]], K]], GetTypesAtNames[K, SelectFromTuple[K, TupleContainsIdx[SelectFromTuple[K, Negate[NumericColsIdx[V]]], K]], V]]]
inline def numericColSummary[S <: String](using ev: IsColumn[S, K] =:= true, isNum: IsNumeric[GetTypeAtName[K, S, V]] =:= true, s: ValueOf[S], a: Fractional[GetTypeAtName[K, S, V]]): NamedTuple[("mean", "std", "min", "25%", "50%", "75%", "max"), (GetTypeAtName[K, S, V], Double, GetTypeAtName[K, S, V], Double, Double, Double, GetTypeAtName[K, S, V])]
inline def numericCols: Iterator[NamedTuple[SelectFromTuple[K, TupleContainsIdx[SelectFromTuple[K, NumericColsIdx[V]], K]], GetTypesAtNames[K, SelectFromTuple[K, TupleContainsIdx[SelectFromTuple[K, NumericColsIdx[V]], K]], V]]]
inline def renameColumn[From <: String, To <: String](using ev: IsColumn[From, K] =:= true, FROM: ValueOf[From], TO: ValueOf[To]): Iterator[NamedTuple[ReplaceOneName[K, From, To], V]]
extension [K <: Tuple, V <: Tuple](nt: Seq[NamedTuple[K, V]])
inline def addColumn[S <: String, A](fct: NamedTuple[K, V] => A): Seq[NamedTuple[Append[K, S], Append[V, A]]]
inline def column[S <: String](using ev: IsColumn[S, K] =:= true, s: ValueOf[S]): Seq[GetTypeAtName[K, S, V]]
inline def columns[ST <: Tuple](using ev: AllAreColumns[ST, K] =:= true): Seq[NamedTuple[SelectFromTuple[K, TupleContainsIdx[ST, K]], GetTypesAtNames[K, SelectFromTuple[K, TupleContainsIdx[ST, K]], V]]]
inline def dropColumn[S <: String](using ev: IsColumn[S, K] =:= true, s: ValueOf[S]): Seq[NamedTuple[DropOneName[K, S], DropOneTypeAtName[K, S, V]]]
inline def mapColumn[S <: String, A](fct: GetTypeAtName[K, S, V] => A)(using ev: IsColumn[S, K] =:= true, s: ValueOf[S]): Seq[NamedTuple[K, ReplaceOneTypeAtName[K, S, V, A]]]
inline def nonNumericCols: Seq[NamedTuple[SelectFromTuple[K, TupleContainsIdx[SelectFromTuple[K, Negate[NumericColsIdx[V]]], K]], GetTypesAtNames[K, SelectFromTuple[K, TupleContainsIdx[SelectFromTuple[K, Negate[NumericColsIdx[V]]], K]], V]]]
inline def numericCols: Seq[NamedTuple[SelectFromTuple[K, TupleContainsIdx[SelectFromTuple[K, NumericColsIdx[V]], K]], GetTypesAtNames[K, SelectFromTuple[K, TupleContainsIdx[SelectFromTuple[K, NumericColsIdx[V]], K]], V]]]
inline def renameColumn[From <: String, To <: String](using ev: IsColumn[From, K] =:= true, FROM: ValueOf[From], TO: ValueOf[To]): Seq[NamedTuple[ReplaceOneName[K, From, To], V]]
In this article