   ;[2 3]
   ;[4 6]
   ;[7 8]
-  (m/select matrix n (remove (partial = n)
-                             (range (m/column-count matrix)))))
+  (let [r (m/get-row matrix n)]
+    (i.core/matrix
+     (concat (subvec r 0 n)
+             (subvec r (inc n) (m/column-count matrix)))))
+  (m/select matrix
+            n
+            (remove (partial = n)
+                    (range (m/column-count matrix)))))
 
 ;43 def x2p(X = Math.array([]), tol = 1e-5, perplexity = 30.0):
 ;44     """Performs a binary search to get P-values in such a way that each conditional Gaussian has the same perplexity."""

  ;88             (H, thisP) = Hbeta(Di, beta[i]);
  ;89             Hdiff = H - logU;
  ;90             tries = tries + 1;
  (loop [h-diff h-diff
         this-p (i.core/matrix [] [])
         tries 0]
    ;71         while Math.abs(Hdiff) > tol and tries < 50:

                 sum-x)
        p (m/zero-matrix nr nr)
        beta (one-matrix nr 1)
        log-u (i.core/log perplexity)]))

(defn p-values
  [^Matrix matrix perplexity]
