Fork me on GitHub
#beginners
<
2018-01-25
>
Kari Marttila13:01:03

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

Kari Marttila13:01:32

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

Kari Marttila13:01:17

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

schmee13:01:04

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

schmee13:01:09

so I’d go for Neanderthal

bronsa13:01:49

core.matrix is not dead at all

schmee13:01:28

sorry, got that mixed up with Clatrix, my apologies

Kari Marttila16:01:39

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?

tbaldridge16:01:46

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

tbaldridge16:01:06

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

tbaldridge16:01:31

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

Kari Marttila16:01:55

Ok. Thanks for the information.

Kari Marttila16:01:10

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

tbaldridge16:01:19

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

tbaldridge16:01:37

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

alex31415916:01:11

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

greglook22:01:08

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

greglook22:01:24

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]?

greglook22:01:05

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