Skip to content

Instantly share code, notes, and snippets.

@joetm
joetm / genSankey
Created May 22, 2023 10:04 — forked from ken333135/genSankey
Wrapper Function to create Sankey Diagram from DataFrame
def genSankey(df,cat_cols=[],value_cols='',title='Sankey Diagram'):
# maximum of 6 value cols -> 6 colors
colorPalette = ['#4B8BBE','#306998','#FFE873','#FFD43B','#646464']
labelList = []
colorNumList = []
for catCol in cat_cols:
labelListTemp = list(set(df[catCol].values))
colorNumList.append(len(labelListTemp))
labelList = labelList + labelListTemp
@joetm
joetm / count_ckpt_param.py
Created July 7, 2022 08:46 — forked from dalgu90/count_ckpt_param.py
Count the number of parameter in a TensorFlow checkpoint file. (Usage: python count_ckpt_param.py path-to-ckpt)
#!/usr/bin/env python
import sys
import tensorflow as tf
import numpy as np
if len(sys.argv) == 2:
ckpt_fpath = sys.argv[1]
else:
print('Usage: python count_ckpt_param.py path-to-ckpt')
var $ = document.querySelector.bind(document);
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"resourcePath": "/lfs",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"resourcePath": "/census",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"resourcePath": "/vacancies",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"resourcePath": "/wf",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
{"apiVersion":"1.0.0","swaggerVersion":"1.2","resourcePath":"/apprenticeships","produces":["application/json"],"consumes":["application/json"],"protocols":["http"],"apis":[{"path":"/apprenticeships/find","operations":[{"method":"GET","summary":"Get apprenticeship programmes by either SOC code, programme code, or a text search.","position":0,"notes":"You must provide exactly one of the <code>soc</code>, <code>code</code> or <code>search</code> parameters.","deprecated":false,"nickname":"find","parameters":[{"name":"search","description":"Text search.","required":false,"paramType":"query","type":"string"},{"name":"code","description":"Apprenticeship programme code.","required":false,"paramType":"query","type":"string"},{"name":"soc","description":"SOC code.","required":false,"paramType":"query","type":"integer","format":"int32"},{"name":"accesskey","description":"This query is not public yet. Provide your access key.","required":true,"paramType":"query","type":"string"}],"type":"array","items":{"$ref":"ApprProg
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"resourcePath": "/o-net",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
{
"apiVersion": "1.0.0",
"swaggerVersion": "1.2",
"resourcePath": "/soc",
"produces": [
"application/json"
],
"consumes": [
"application/json"
],