This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# License: BSD | |
# Copyright: Adam Allevato 2018 | |
# | |
# FizzBuzz example program and associated tests. | |
# | |
from cStringIO import StringIO | |
import sys |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# Copyright (c) Diligent Robotics, 2018 | |
# Copyright (c) Adam Allevato, 2018 | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# | |
# * Redistributions of source code must retain the above copyright notice, this |
This file contains hidden or 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
import pandas as pd | |
import numpy as np | |
#################################### | |
# BASICS | |
#################################### | |
# load from CSV | |
# see https://chrisalbon.com/python/data_wrangling/pandas_dataframe_importing_csv/ |
This file contains hidden or 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
import numpy as np | |
from sklearn import mixture | |
# make a GMM | |
gmm = mixture.GaussianMixture(n_components=n_components, covariance_type=cv_type) | |
# fit the GMM however you'd like | |
# save to file | |
gmm_name = 'new_gmm' | |
np.save(gmm_name + '_weights', gmm.weights_, allow_pickle=False) |
This file contains hidden or 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
git diff --no-ext-diff -p -R --no-color | grep -E "^(diff|(old|new) mode)" --color=never | git apply |