Skip to content

Commit 57a9768

Browse files
Automated commit of generated code
1 parent 24add0a commit 57a9768

File tree

1 file changed

+145
-0
lines changed
  • core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api

1 file changed

+145
-0
lines changed

core/generated-sources/src/main/kotlin/org/jetbrains/kotlinx/dataframe/api/distinct.kt

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.jetbrains.kotlinx.dataframe.AnyColumnReference
44
import org.jetbrains.kotlinx.dataframe.ColumnsSelector
55
import org.jetbrains.kotlinx.dataframe.DataFrame
66
import org.jetbrains.kotlinx.dataframe.annotations.AccessApiOverload
7+
import org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions
78
import org.jetbrains.kotlinx.dataframe.columns.ColumnSet
89
import org.jetbrains.kotlinx.dataframe.columns.SingleColumn
910
import org.jetbrains.kotlinx.dataframe.columns.toColumnSet
@@ -14,33 +15,177 @@ import kotlin.reflect.KProperty
1415

1516
// region DataFrame
1617

18+
/**
19+
* ## The Distinct Operation
20+
*
21+
* It removes duplicated rows based on all columns.
22+
*
23+
* __NOTE:__ The rows in the resulting [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] are in the same order as they were in the original [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame].
24+
*
25+
*
26+
*
27+
* @return A new DataFrame containing only distinct rows.
28+
*
29+
* @see [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions].
30+
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
31+
* .
32+
*
33+
*/
1734
public fun <T> DataFrame<T>.distinct(): DataFrame<T> = distinctBy { all() }
1835

36+
/**
37+
* ## The Distinct Operation
38+
*
39+
* It removes duplicated rows based on the specified columns.
40+
*
41+
* __NOTE:__ The rows in the resulting [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] are in the same order as they were in the original [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame].
42+
*
43+
* @param [columns][org.jetbrains.kotlinx.dataframe.columns]
44+
* The names of the columns to consider for evaluating distinct rows.
45+
*
46+
* @return A new DataFrame containing only distinct rows.
47+
*
48+
* @see [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions].
49+
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
50+
* .
51+
*/
1952
public fun <T, C> DataFrame<T>.distinct(columns: ColumnsSelector<T, C>): DataFrame<T> = select(columns).distinct()
2053

54+
/**
55+
* ## The Distinct Operation
56+
*
57+
* It removes duplicated rows based on the specified columns.
58+
*
59+
* __NOTE:__ The rows in the resulting [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] are in the same order as they were in the original [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame].
60+
*
61+
* @param [columns][org.jetbrains.kotlinx.dataframe.columns]
62+
* The names of the columns to consider for evaluating distinct rows.
63+
*
64+
* @return A new DataFrame containing only distinct rows.
65+
*
66+
* @see [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions].
67+
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
68+
* .
69+
*/
2170
@AccessApiOverload
2271
public fun <T> DataFrame<T>.distinct(vararg columns: KProperty<*>): DataFrame<T> =
2372
distinct {
2473
val set = columns.toColumnSet()
2574
set
2675
}
2776

77+
/**
78+
* ## The Distinct Operation
79+
*
80+
* It removes duplicated rows based on the specified columns.
81+
*
82+
* __NOTE:__ The rows in the resulting [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] are in the same order as they were in the original [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame].
83+
*
84+
* @param [columns][org.jetbrains.kotlinx.dataframe.columns]
85+
* The names of the columns to consider for evaluating distinct rows.
86+
*
87+
* @return A new DataFrame containing only distinct rows.
88+
*
89+
* @see [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions].
90+
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
91+
* .
92+
*/
2893
public fun <T> DataFrame<T>.distinct(vararg columns: String): DataFrame<T> = distinct { columns.toColumnSet() }
2994

95+
/**
96+
* ## The Distinct Operation
97+
*
98+
* It removes duplicated rows based on the specified columns.
99+
*
100+
* __NOTE:__ The rows in the resulting [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] are in the same order as they were in the original [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame].
101+
*
102+
* @param [columns][org.jetbrains.kotlinx.dataframe.columns]
103+
* The names of the columns to consider for evaluating distinct rows.
104+
*
105+
* @return A new DataFrame containing only distinct rows.
106+
*
107+
* @see [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions].
108+
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
109+
* .
110+
*/
30111
@AccessApiOverload
31112
public fun <T> DataFrame<T>.distinct(vararg columns: AnyColumnReference): DataFrame<T> =
32113
distinct { columns.toColumnSet() }
33114

115+
/**
116+
* ## The Distinct Operation
117+
*
118+
* It removes duplicated rows based on the specified columns.
119+
*
120+
* __NOTE:__ The rows in the resulting [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] are in the same order as they were in the original [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame].
121+
*
122+
* @param [columns][org.jetbrains.kotlinx.dataframe.columns]
123+
* The names of the columns to consider for evaluating distinct rows.
124+
*
125+
* @return A new DataFrame containing only distinct rows.
126+
*
127+
* @see [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions].
128+
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
129+
* .
130+
*/
34131
@AccessApiOverload
35132
public fun <T> DataFrame<T>.distinctBy(vararg columns: KProperty<*>): DataFrame<T> =
36133
distinctBy { columns.toColumnSet() }
37134

135+
/**
136+
* ## The Distinct Operation
137+
*
138+
* It removes duplicated rows based on the specified columns.
139+
*
140+
* __NOTE:__ The rows in the resulting [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] are in the same order as they were in the original [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame].
141+
*
142+
* @param [columns][org.jetbrains.kotlinx.dataframe.columns]
143+
* The names of the columns to consider for evaluating distinct rows.
144+
*
145+
* @return A new DataFrame containing only distinct rows.
146+
*
147+
* @see [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions].
148+
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
149+
* .
150+
*/
38151
public fun <T> DataFrame<T>.distinctBy(vararg columns: String): DataFrame<T> = distinctBy { columns.toColumnSet() }
39152

153+
/**
154+
* ## The Distinct Operation
155+
*
156+
* It removes duplicated rows based on the specified columns.
157+
*
158+
* __NOTE:__ The rows in the resulting [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] are in the same order as they were in the original [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame].
159+
*
160+
* @param [columns][org.jetbrains.kotlinx.dataframe.columns]
161+
* The names of the columns to consider for evaluating distinct rows.
162+
*
163+
* @return A new DataFrame containing only distinct rows.
164+
*
165+
* @see [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions].
166+
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
167+
* .
168+
*/
40169
@AccessApiOverload
41170
public fun <T> DataFrame<T>.distinctBy(vararg columns: AnyColumnReference): DataFrame<T> =
42171
distinctBy { columns.toColumnSet() }
43172

173+
/**
174+
* ## The Distinct Operation
175+
*
176+
* It removes duplicated rows based on the specified columns.
177+
*
178+
* __NOTE:__ The rows in the resulting [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame] are in the same order as they were in the original [DataFrame][org.jetbrains.kotlinx.dataframe.DataFrame].
179+
*
180+
* @param [columns][org.jetbrains.kotlinx.dataframe.columns]
181+
* The names of the columns to consider for evaluating distinct rows.
182+
*
183+
* @return A new DataFrame containing only distinct rows.
184+
*
185+
* @see [Selecting Columns][org.jetbrains.kotlinx.dataframe.api.Select.SelectSelectingOptions].
186+
* @see <a href="https://kotlin.github.io/dataframe/distinct.html">See `distinct` on the documentation website.</a>
187+
* .
188+
*/
44189
public fun <T, C> DataFrame<T>.distinctBy(columns: ColumnsSelector<T, C>): DataFrame<T> {
45190
val cols = get(columns)
46191
val distinctIndices = indices.distinctBy { i -> cols.map { it[i] } }

0 commit comments

Comments
 (0)