Skip to content

Commit

Permalink
example clean up
Browse files Browse the repository at this point in the history
xslice'ing
00,02,04 run clean.

Signed-off-by: AJ Rossini <blindglobe@gmail.com>
  • Loading branch information
blindglobe committed Nov 19, 2013
1 parent 28d1a58 commit 3ec4370
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
4 changes: 3 additions & 1 deletion examples/00-loadingData.lisp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; -*- mode: lisp -*-

;;; Time-stamp: <2013-10-18 08:54:06 tony>
;;; Time-stamp: <2013-11-18 10:56:10 tony>
;;; Creation: <2009-03-12 17:14:56 tony>
;;; File: 00-loadingData.lisp
;;; Author: AJ Rossini <blindglobe@gmail.com>
Expand All @@ -15,12 +15,14 @@

;;; load the systems we need
(ql:quickload :data-format-validation)
(ql:quickload :antik) ;; for all the wrong reasons
(ql:quickload :cls)

;;; create the package that we will be working in.
;; The CLS-EXAMPLES package is similar setup to CLS-USER package.
(cl:defpackage :cls-examples
(:use :common-lisp
:xarray
:lisp-matrix
:data-format-validation
:common-lisp-statistics)
Expand Down
4 changes: 2 additions & 2 deletions examples/02-dataframeBuilding.lisp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; -*- mode: lisp -*-

;;; Time-stamp: <2013-11-01 10:46:23 tony>
;;; Time-stamp: <2013-11-18 15:04:22 tony>
;;; Creation: <2012-11-02 08:14:38 tony>
;;; File: 02-DSVloading.lisp
;;; Author: AJ Rossini <blindglobe@gmail.com>
Expand All @@ -25,7 +25,7 @@
;;;; BROKEN unless you are running your lisp in the CLS home
;;;; directory. Until we fix this, might have to edit so that you
;;;; load from the right place.
(load "examples/00-loadingData.lisp")
;(load "examples/00-loadingData.lisp")

(in-package :cls-examples)

Expand Down
34 changes: 29 additions & 5 deletions examples/04-dataManipulation.lisp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; -*- mode: lisp -*-

;;; Time-stamp: <2013-11-01 10:39:46 tony>
;;; Time-stamp: <2013-11-19 07:26:16 tony>
;;; Creation: <2009-03-12 17:14:56 tony>
;;; File: data-manipulation.lisp
;;; Author: AJ Rossini <blindglobe@gmail.com>
Expand All @@ -13,7 +13,7 @@
;;; designers and quality assurance people in its wake.


(load "examples/02-dataframeBuilding.lisp")
;(load "examples/02-dataframeBuilding.lisp")

;; Use the CLS examples playground for access to example data.
(in-package :cls-examples)
Expand Down Expand Up @@ -85,15 +85,39 @@
;;; Setting/putting elements


;;; Column and row extraction
;; Individual array elements
(= 23.0 (xref *ex-array* 1 2)) ; at this stage, T
(setf (xref *ex-array* 1 2) 24.0)
(= 23.0 (xref *ex-array* 1 2)) ; at this stage, NIL
(setf (xref *ex-array* 1 2) 23.0)
(= 23.0 (xref *ex-array* 1 2)) ; and T again...


;;; Column and row setting

;;; Column and row extraction, including sub-matrix-like, sub-array or
;;; sub-dataframe-like extraction

(xslice *ex-array* '(1) :all)
(xslice *ex-array* '(1 2) :all)
(xslice *ex-array* '(0 1) '(3))
(xslice *ex-array* :all '(0 1))


;;; FIXME: NOT WORKING YET WITH DATAFRAME-LIKE OR MATRIX-LIKE
;;;
;; (xslice *ex-array-df* '(1) :all) ;; FIXME: error
;; (xslice *ex-array-mat* '(1) '(2)) ;; FIXME: no subsetting
;; (xslice *ex-lol-df* '(1) :all) ;; FIXME: error
;; (xslice *ex-array-mat* '(1) '(2)) ;; FIXME: no subsetting

;;; Column and row setting, FIXME: NONE WORK!

;; (setf (xslice *ex-array* '(1) :all) #2A((1.0 2.0 3.0 4.0)))
;; (xslice *ex-array* '(1 2) :all)


;;; Column and row combining for new DFs


;;; sub-matrix-like, sub-array or sub-dataframe-like extraction


0 comments on commit 3ec4370

Please sign in to comment.