mymap이 생성되는 것과 동시에 'mymap'의 값을 문자열 목록 대신 Doubles 목록으로 변환하려면 어떻게해야합니까?폐쇄 목록에서 문자열 목록을 복식 목록으로 변환하려면 어떻게해야합니까?
(use '[clojure.string :only (join split)])
;(def raw-data (slurp "http://ichart.finance.yahoo.com/table.csv?s=INTC"))
;Downloaded and removed the first line
(def raw-data (slurp "table-INTC.csv"))
(def raw-vector-list
(map
#(split % #",") ; anonymous map function to split by comma
(split raw-data #"\n"))) ; split raw data by new line
(pr (take 1 raw-vector-list))
(def mymap
(zipmap
;construct composite key out of symbol and date which is head of the list
(map #(str "INTC-" %) (map first raw-vector-list))
;How do i convert these values to Double instead of Strings?
(map rest raw-vector-list)))
(pr (take 1 mymap))
Clojure의 csv 패키지는 여기에 상당한 양의 코드를 저장합니다. https://github.com/davidsantiago/clojure-csv – Bill
일단 내가 기본 수준에서하고있는 도대체에 대해 잘 이해하면, 나는 그것을 탐구 할 것이다. 감사. – lunkdjedi