We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c54599 commit d44f27cCopy full SHA for d44f27c
src/tech/v3/dataset_api.clj
@@ -216,10 +216,26 @@ user> (ds/rowvec-at stocks -1)
216
((rowvecs ds) idx))
217
218
219
+(defn empty-column-names
220
+ "Return a sequence of column names whose empty set length matches the row count of the dataset."
221
+ [ds]
222
+ (let [rc (row-count ds)]
223
+ (->> (columns ds)
224
+ (lznc/map #(when (== rc (long (dtype/ecount (missing %))))
225
+ (:name (meta %))))
226
+ (lznc/remove nil?))))
227
+
228
229
+(defn remove-empty-columns
230
+ "Remove all columns that have no data - missing set length equals row count."
231
232
+ (remove-columns ds (empty-column-names ds)))
233
234
235
(export-symbols tech.v3.dataset.io
- ->dataset
- ->>dataset
- write!)
236
+ ->dataset
237
+ ->>dataset
238
+ write!)
239
240
241
(defn dataset-parser
0 commit comments