Skip to content

Instantly share code, notes, and snippets.

@jfreels
jfreels / average_duration_stream.py
Created November 30, 2021 00:11
Determine average duration for each step across all sessions
""" Determine average duration for each step across all sessions """
import sys
STREAM = [
# session, step, timestamp
[1001, 1, 100000010], # duration = 11
[1001, 2, 100000021], # duration = 12
[1001, 3, 100000033], # duration = 13
[1001, 4, 100000046], # duration = None (there's no next step)
[1002, 1, 100000010], # duration = 10
@jfreels
jfreels / l7d.py
Created November 30, 2021 00:10
Determine product usage over the last 7 days
""" Determine product usage over the last 7 days """
import sys
DATALIST = {
"android": [0,1,1,0,1,1,1],
"iphone": [0,1,1,0,1,1,0],
"web": [0,0,0,1,1,1,1]
}
import sys
import tableauserverclient as tsc
TABLEAU_CREDENTIALS = {
"server_url": "",
"username": "",
"password": "",
"site": ""
}
@jfreels
jfreels / README.md
Last active December 26, 2015 04:09
d3js: D.R.Y. update/enter/exit paragraph with Select input

d3js: D.R.Y. update/enter/exit paragraph with Select input

@jfreels
jfreels / README.md
Last active December 25, 2015 22:09
d3js: Return, Cumulative Return, Drawdown, and Drought line graphs with tooltips.

d3js: Return, Cumulative Return, Drawdown, and Drought line graphs with tooltips.

@jfreels
jfreels / README.md
Last active December 25, 2015 19:49
d3js: Return, Cumulative Return, and Drawdown line graphs.

d3js: Return, Cumulative Return, and Drawdown line graphs.

@jfreels
jfreels / README.md
Last active December 25, 2015 17:49
d3js: Line chart changing with select input.

d3js: Line chart changing with select input.

@jfreels
jfreels / README.md
Last active December 25, 2015 17:09
d3js: d3.nest() and filter() using Select box and svg circles.

d3js: d3.nest() and filter() using Select box and svg circles.

@jfreels
jfreels / README.md
Created October 11, 2013 21:03
d3js: Allocation, return, and attribution example. Sortable, horizontal bar chart with positive and negative values that change on select input.
@jfreels
jfreels / README.md
Last active December 25, 2015 05:39
Sublime Text user settings

sublime text settings