import numpy as np
from scipy.ndimage import gaussian_filter
from scipy import misc
import pandas as pd


__all__ = ['rand_array', 'smooth_image', 'my_mat_solve', 'concatenate_dfs_from_dicts']


def rand_array(shape):
    return np.random.rand(*shape)

def smooth_image(a, sigma=1):
    return gaussian_filter(a, sigma=sigma)

def my_mat_solve(A, b):
    return A.inv()*b

def concatenate_dfs_from_dicts(dict_A, dict_B):
    df_A = pd.DataFrame(dict_A)
    df_B = pd.DataFrame(dict_B)

    frames = [df_A, df_B]

    return pd.concat(frames)


