Skip to content

Instantly share code, notes, and snippets.

@yoki
yoki / chap4-numpy.py
Created June 21, 2014 08:42
Chapter 4 Numpy
# -*- coding: utf-8 -*-
import numpy as np
#===========================================
#%% Index and element wise operation
#===========================================
#%% logical indexing
data = np.random.randn(7,4)
names = np.array(['Bob', 'Joe', 'Will', 'Bob', 'Will', 'Joe', 'Joe'])
@yoki
yoki / io.js
Last active December 26, 2019 23:30
JS io
// Easiest
// Mydata.json.js defines a variable
<script src="mydata.json.js"></script>
//? work
fetch("test.json")
.then(response => response.json())
.then(json => console.log(json));
@yoki
yoki / bash_profile.sh
Last active May 25, 2020 14:24
bash_profile
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export CLICOLOR=1
export TERM=xterm-color
export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1
export HISTFILESIZE=100000
export HISTSIZE=100000
export LSCOLORS=GxFxCxDxBxegedabagaced
# Variable, type and functions https://github.com/PacktPublishing/Julia-1.0-Programming-Cookbook/tree/master/Chapter05
@yoki
yoki / update-insert.sql
Last active August 23, 2020 14:18
update-insert.sql
UPDATE courses_question q
SET video = ''
FROM courses_questioncategory qc
WHERE qc.category = 'recordingVoiceImageOnly'
AND q.question_category_id = qc.id
# 1_matplotlib
# 2_seaborn
@yoki
yoki / main.py
Created December 26, 2020 01:50
Python Errors and Exceptions
try:
func()
except IOError as exc:
print(exc)
raise exc
@yoki
yoki / 0_XML.py
Last active June 17, 2022 17:44
Python XML
# xml document
# edit.py
# encode.py
# extract.py
# namespace.py
# search.py