change pk to united keys, django will add a new id field, original data will become null-value on id column
- solution: always add id field as pk
- refs: https://docs.djangoproject.com/en/2.0/topics/db/models/#automatic-primary-key-fields
import numpy as np | |
import scipy.stats | |
from statsmodels.stats.proportion import proportions_ztest | |
def get_p1_p2_alternative(s, t): | |
""" | |
return alternative base on actual p1, p2 | |
""" |
First of all, it just seems like doing anything with Oracle is obnoxiously painful for no good reason. It's the nature of the beast I suppose. cx_oracle is a python module that allows you to connect to an Oracle Database and issue queries, inserts, updates..usual jazz.
Step 1:
sudo apt-get install build-essential unzip python-dev libaio-dev
Step 2. Click here to download the appropriate zip files required for this. You'll need:
Portions taken from http://www.cs.utexas.edu/~mitra/csSpring2011/cs327/cx_mac.html (in case that link ever dies.)
Assume you've got homebrew installed.
Download the following files from Oracle
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import sched, time | |
from threading import Thread, Timer | |
import subprocess | |
s = sched.scheduler(time.time, time.sleep) | |
class Job(Thread): |