In [1]:
import matplotlib.pyplot as plt
import numpy as np
import collections
import tensorflow as tf
import tensorflow_probability as tfp
tfd = tfp.distributions
tfb = tfp.bijectors
tfe = tf.contrib.eager
tfe.enable_eager_execution()
from __future__ import print_function
In [2]:
from scipy.stats import geom
In [7]:
rvs = geom.rvs(0.1, size=1000)
In [8]:
plt.plot(rvs)
Out[8]:
In [14]:
import pandas as pd
a = pd.DataFrame([[1,2,3], [4,5,9]])
a.mean(axis=0)
Out[14]:
In [15]:
a.divide(a.mean(axis=0))
Out[15]:
In [16]:
import cv2
import numpy as np
ann_img = np.zeros((30,30,3)).astype('uint8')
ann_img[ 3 , 4 ] = 1 # this would set the label of pixel 3,4 as 1
cv2.imwrite( "ann_1.png" ,ann_img )
Out[16]:
In [18]:
ann_img[ 3 , 4 ]
Out[18]:
In [19]:
a = {'d': 1, 'e': 2}
b = {'e': 2, 'd': 1}
a == b
Out[19]:
In [20]:
a.keys()
Out[20]:
In [ ]: