From cafd3773a30ae68d60e08ed413a4cb5a27a07f23 Mon Sep 17 00:00:00 2001 From: alanmarazzi Date: Mon, 12 Aug 2019 11:41:31 +0200 Subject: [PATCH] Fix subset-cols issue with downcasting --- project.clj | 2 +- src/panthera/pandas/generics.clj | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/project.clj b/project.clj index 485b22b..0a75a1d 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject panthera "0.1-alpha.15" +(defproject panthera "0.1-alpha.16" :description "Data Frames in Clojure (with Pandas) + NumPy" :url "https://github.com/alanmarazzi/panthera" :scm {:name "git" :url "https://github.com/alanmarazzi/panthera"} diff --git a/src/panthera/pandas/generics.clj b/src/panthera/pandas/generics.clj index 67580a7..1cac6bd 100644 --- a/src/panthera/pandas/generics.clj +++ b/src/panthera/pandas/generics.clj @@ -626,7 +626,10 @@ ;2 6 8 ```" [df & colnames] - (py/get-item df colnames)) + (let [cols (if (= 1 (count colnames)) + (first colnames) + (apply py/->py-list [colnames]))] + (py/get-item df cols))) (defn n-largest "Return the first `:n` values ordered by `:columns` in descending order.