Fork me on GitHub

HI! Looking for a Clojure scientific library like numpy in Python. Any suggestions?


The scientific library should support basic mathematical functions like mean, standard deviation etc. using any data type (vectors, matrices...) (like numpy in Python).


I found Clatrix, core.matrix and Neanderthal. Any recommendations which one to use?


Neanderthal is very active and the author hangs around here a lot while Clatrix and core.matrix are pretty dead


so I’d go for Neanderthal


core.matrix is not dead at all


sorry, got that mixed up with Clatrix, my apologies


Did I understand correctly from the Neanderthal documentation that if you use it you have to install some additional packages in OS level? If yes, isn't this a bit of a nuisance since I don't necessarily know what the target OS will be?


You;’ll find that’s the case with most JVM numerics libraries


Either you get sub-par performance, or you have to install native libs


The JVM just doesn’t give you enough control to do both with pure java.


Ok. Thanks for the information.


So, would you recommend Neanderthal over core.matrix? If I need to manipulate matrices (e.g. linear regression models etc.)...


I can’t help you with that. they’re both fantastic libraries. Core.matrix does have multiple backends however.


So you can start with a pure JVM backend and then swap it out for something that’s a bit faster later


On that topic - any library that can do pandas DataFrame type representation? If I were to implement a subset myself, would you recommend representation as [ {:date d1 :a 2 :b 3}] or { :d1 {:a 2 :b 3}} ?

Victor Ferreira22:01:10

Hey guys I want to make a api that will receive one request and add 1 element in array something like it first request GET /api/1 response -> [1] second request GET /api/2 response -> [1, 2] What's the best way that I can save in memory this data (list)? now i'm using compojure to make this end points


sounds like you want an atom to keep track of the call state


so (def memory (atom [])) to initialize, then on each call return (swap! memory conj my-path-number)

Victor Ferreira22:01:21

I saw atom but I don't know to change all data of it, but atom can help, how I change all data from atom so I have an atom with [1 2 3] but I want change to another atom [5 "bvcbvc" 6]?


you can set the current value to something new with reset!, which just replaces the current value

Victor Ferreira22:01:54

Ty, I will test it