Clojure Inspector
A visual browser for Clojure data using the Java UI librariesdf465x.
inspect
for flat data structuresinspect-tree
for deeply nested / hierarchically datainspect-table
a sequence of data structures with the same shape
inspect
View flat structures especially with non-trivial size data sets.
This example generated 10,000 random numbers. The Clojure inspector shows the values along with their index in the collection.
(inspector/inspect
(repeatedly 10000 #(rand-int 101)))
inspect-tree
(inspect
{:starwars
{:characters
{:jedi ["obiwan kenobi" "Yoda" "Master Wendoo"]
:sith ["Palpatine" "Count Dukoo"]}}})
inspect-table
Inspect a sequence of data structures that share the same form, often found in data sets for machine learning and wider data scients, eg. daily weather records.
This example generates mock data for a 20 day period for one or more locations. Each day contains the day, location and cumulative number of cases reported.
(defn mock-data-set
"Generates a set of mock data for each name
Arguments: names as strings, names used in keys
Returns: Sequence of maps, each representing confirmed cases"
[& locations]
(for [location locations
day (range 20)]
{:day day
:location location
:cases (+ (Math/pow (* day (count location)) 0.8)
(rand-int (count location)))}))
(inspector/inspect-table
(mock-data-set "England" "Scotland" "Wales" "Northern Ireland"))
当前内容版权归 practicalli 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 practicalli .