Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring column exploration doc up-to-date #95

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
techascent/tech.ml.dataset {:mvn/version "7.000-beta-27"}
;; generateme/fastmath {:mvn/version "2.1.0"}
}
:aliases {:dev {:extra-deps {org.scicloj/clay {:mvn/version "1-alpha14"}}}}}
:aliases {:dev {:extra-deps {org.scicloj/clay {:mvn/version "2-alpha12"}}}}}
40 changes: 19 additions & 21 deletions docs/column_exploration.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@
^{:kind/hidden true}
(ns intro
(:require [tablecloth.api :as tc]
[scicloj.clay.v1.api :as clay]
[scicloj.clay.v1.tools :as tools]
[scicloj.clay.v1.tool.scittle :as scittle]
[scicloj.kindly.v2.kind :as kind]
[scicloj.clay.v1.view.dataset]
[nextjournal.clerk :as clerk]))
[scicloj.clay.v2.api :as clay]
[scicloj.kindly.v3.api :as kindly]
[scicloj.kindly.v3.kind :as kind]
))

^{:kind/hidden true}
#_(clay/restart! {:tools [#_tools/scittle
tools/clerk]})
(clay/start!)

^{:kind/hidden true}
(comment
(clerk/show!)

(do (scittle/show-doc! "docs/column_exploration.clj" {:hide-doc? true})
(scittle/write-html! "docs/column_exploration.html"))
(do (clay/show-doc! "docs/column_exploration.clj" {:hide-doc? true}))
,)

;; ## What is this exploration?
Expand Down Expand Up @@ -58,21 +52,25 @@

;; ### Basic Operations

;; Right now we need to use the functional name space from the
;; underlying computation library tech.v3.datatype to operate on
;; columns.

(require '[tech.v3.datatype.functional :as fun])
;; Operations are right now in their own namespace
(require '[tablecloth.column.api.operators :as ops])

;; With that imported we can perform a large number of operations:

(def a (column [20 30 40 50]))
(def b (column (range 4)))

(fun/- a b)
(ops/- a b)

(ops/pow a 2)

(ops/* 10 (fun/sin a))

(fun/pow a 2)
(ops/< a 35)

(fun/* 10 (fun/sin a))
;; All these operations take a column as their first argument and
;; return a column, so they can be chained easily.

(fun/< a 35)
(-> a
(ops/* b)
(ops/< 70))