Skip to content

Instantly share code, notes, and snippets.

@anurlybayev
anurlybayev / numpy.swift
Created April 1, 2018 02:51
numpy in Swift
import Python
let np = Python.import("numpy")
let x = np.array([6, 7, 8])
let y = np.arange(24).reshape(2, 3, 4)
let a = np.ones(3, dtype: np.int32)
let b = np.linspace(0, pi, 3)
let c = a+b
let d = np.exp(c)

Videos

// my little html string builder
buildHTML = function(tag, html, attrs) {
// you can skip html param
if (typeof(html) != 'string') {
attrs = html;
html = null;
}
var h = '<' + tag;
for (attr in attrs) {
if(attrs[attr] === false) continue;