@@ -100,8 +100,17 @@ public fun <T, C> DataFrame<T>.fillNulls(vararg columns: ColumnReference<C>): Up
100
100
101
101
// endregion
102
102
103
+ /* * Is only `true` if [this] is [Double.NaN] or [Float.NaN]. */
103
104
internal inline val Any? .isNaN: Boolean get() = (this is Double && isNaN()) || (this is Float && isNaN())
104
105
106
+ /* *
107
+ * Returns `true` if [this] is considered NA.
108
+ * "NA", in DataFrame, roughly means `null` or `NaN`.
109
+ *
110
+ * Overload of `isNA` with contract support.
111
+ *
112
+ * @see NA
113
+ */
105
114
@JvmName(" isNaWithContract" )
106
115
@Suppress(" NOTHING_TO_INLINE" )
107
116
@OptIn(ExperimentalContracts ::class )
@@ -110,6 +119,11 @@ internal inline fun <T : Any?> T.isNA(): Boolean {
110
119
return isNA
111
120
}
112
121
122
+ /* *
123
+ * Is `true` if [this] is considered NA.
124
+ * "NA", in DataFrame, roughly means `null` or `NaN`.
125
+ * @see NA
126
+ */
113
127
internal inline val Any? .isNA: Boolean
114
128
get() = when (this ) {
115
129
null -> true
@@ -122,10 +136,22 @@ internal inline val Any?.isNA: Boolean
122
136
123
137
internal inline val AnyCol .canHaveNaN: Boolean get() = typeClass.let { it == Double ::class || it == Float ::class }
124
138
139
+ /* *
140
+ * Is `true` when [this] column can have [NA] values.
141
+ * @see NA
142
+ */
125
143
internal inline val AnyCol .canHaveNA: Boolean get() = hasNulls() || canHaveNaN || kind() != ColumnKind .Value
126
144
145
+ /* *
146
+ * Is `true` when [this] is `null` or [Double.NaN].
147
+ * @see NA
148
+ */
127
149
internal inline val Double? .isNA: Boolean get() = this == null || this .isNaN()
128
150
151
+ /* *
152
+ * Is `true` when [this] is `null` or [Float.NaN].
153
+ * @see NA
154
+ */
129
155
internal inline val Float? .isNA: Boolean get() = this == null || this .isNaN()
130
156
131
157
// region fillNaNs
0 commit comments