This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from trees.models import Tree, Post, Member | |
from datetime import datetime, timedelta | |
def percentRetained(): | |
'''Iterate over periods of 2 weeks, filter out all users who didn't add a post during that 2-weeks-period. | |
Start with particular group of two weeks, see who used it for that 2-week period. | |
For every period of two weeks, filter out people who are not''' | |
today = datetime.today() | |
experiment_duration = 7 * 4 * 3 | |
retained_members = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
choices = float(10**8) | |
p = 1 | |
for i in range (1000): | |
p = p * (choices - i) / choices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://nbviewer.jupyter.org/github/ipython/ipython/blob/master/examples/IPython%20Kernel/Importing%20Notebooks.ipynb | |
import io, os, sys, types | |
import nbformat | |
from IPython import get_ipython | |
from IPython.core.interactiveshell import InteractiveShell | |
def find_notebook(fullname, path=None): |