Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there an equivalent of data-frame in OCaml?

Tags:

pandas

ocaml

I have been on the R side for some years. I don't do any hardcore statistics, but rather use R as a sophisticated 'csv-files' manipulater. nevertheless, i do need to process a huge amout of data, in a distributed way.

I found that R is not fast enough for my application anymore and I am now investigating other languages.

the first choice is Python-pandas, which is faster. Also, I read that Ocaml could be 10x faster than python, which sounds very attractive to me.

However, i found that the standard libraries of Ocaml seems to be quite low-level. I cannot find any high-level containers like R's data frame.

How do you guys represent data frames in Ocaml? do you use a list of tuples? can anyone share a bit knowledge here?

thanks!

like image 640
James Bond Avatar asked Nov 20 '13 17:11

James Bond


1 Answers

I had to google for data frames in R, not being familiar with R, but it seems like you're looking for records, or perhaps a list of records. Or as you suggest, maybe a list of tuples would have similar properties to R data frames if you add some functions to access the data in the tuples more easily. But I think records would be closer as you can refer to the name of a field in the record.

See the chapter on Records in Real World OCaml.

like image 80
aneccodeal Avatar answered Oct 01 '22 04:10

aneccodeal