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, V, K1 <: Tuple & K, V1 <: Tuple & K](itr: Iterator[NamedTuple[K1, V1]])
inline def addColumn[S <: String, A](fct: NamedTuple[K1, V1] => A): Iterator[NamedTuple[Append[K1, S], Append[V1, A]]]
inline def column[S <: String](using ev: IsColumn[S, K1] =:= true, s: ValueOf[S]): Iterator[GetTypeAtName[K1, S, V1]]
inline def columns[ST <: Tuple](using ev: AllAreColumns[ST, K1] =:= true): Iterator[NamedTuple[SelectFromTuple[K1, TupleContainsIdx[ST, K1]], GetTypesAtNames[K1, SelectFromTuple[K1, TupleContainsIdx[ST, K1]], V1]]]
inline def dropColumn[S <: String](using ev: IsColumn[S, K1] =:= true, s: ValueOf[S]): Iterator[NamedTuple[DropOneName[K1, S], DropOneTypeAtName[K1, S, V1]]]
inline def forceColumnType[S <: String, A]: Iterator[NamedTuple[K1, ReplaceOneTypeAtName[K1, S, V1, A]]]
inline def mapColumn[S <: String, A](using ev: IsColumn[S, K1] =:= true, s: ValueOf[S])(fct: GetTypeAtName[K1, S, V1] => A): Iterator[NamedTuple[K1, ReplaceOneTypeAtName[K1, S, V1, A]]]
inline def nonNumericCols: Iterator[NamedTuple[SelectFromTuple[K1, TupleContainsIdx[SelectFromTuple[K1, Negate[NumericColsIdx[V1]]], K1]], GetTypesAtNames[K1, SelectFromTuple[K1, TupleContainsIdx[SelectFromTuple[K1, Negate[NumericColsIdx[V1]]], K1]], V1]]]
inline def numericColSummary[S <: String](using ev: IsColumn[S, K1] =:= true, isNum: IsNumeric[GetTypeAtName[K1, S, V1]] =:= true, s: ValueOf[S], a: Fractional[GetTypeAtName[K1, S, V1]]): NamedTuple[("mean", "std", "min", "25%", "50%", "75%", "max"), (GetTypeAtName[K1, S, V1], Double, GetTypeAtName[K1, S, V1], Double, Double, Double, GetTypeAtName[K1, S, V1])]
inline def numericCols: Iterator[NamedTuple[SelectFromTuple[K1, TupleContainsIdx[SelectFromTuple[K1, NumericColsIdx[V1]], K1]], GetTypesAtNames[K1, SelectFromTuple[K1, TupleContainsIdx[SelectFromTuple[K1, NumericColsIdx[V1]], K1]], V1]]]
inline def renameColumn[From <: String, To <: String](using ev: IsColumn[From, K1] =:= true, FROM: ValueOf[From], TO: ValueOf[To]): Iterator[NamedTuple[ReplaceOneName[K1, From, To], V1]]
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