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 python3 | |
| # ============================================================================== | |
| # Cloud TPU - Cross-Platform General Diagnostic & Quota Verification Utility | |
| # ============================================================================== | |
| # Run this script in Google Cloud Shell or in any terminal authenticated with gcloud. | |
| # Compatible with Linux, macOS, and Windows. Requires only Python 3.6+. | |
| # ============================================================================== | |
| import os | |
| 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
| # TQDM: Python progress bar tutorial | |
| # Youtube Video: https://www.youtube.com/watch?v=n4E7of9BINo | |
| import pandas as pd | |
| import numpy as np | |
| from time import sleep | |
| from tqdm import tqdm, trange | |
| # Create Fake Data | |
| dogs = np.random.choice(['labradoodle','beagle','mutt'], size=50_000) |
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 | |
| def get_dataset(size): | |
| # Create Fake Dataset | |
| df = pd.DataFrame() | |
| df['size'] = np.random.choice(['big','medium','small'], size) | |
| df['age'] = np.random.randint(1, 50, size) | |
| df['team'] = np.random.choice(['red','blue','yellow','green'], size) | |
| df['win'] = np.random.choice(['yes','no'], size) |
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 | |
| def get_dataset(size): | |
| df = pd.DataFrame() | |
| df['position'] = np.random.choice(['left','middle','right'], size) | |
| df['age'] = np.random.randint(1, 50, size) | |
| df['team'] = np.random.choice(['red','blue','yellow','green'], size) | |
| df['win'] = np.random.choice(['yes','no'], size) | |
| df['prob'] = np.random.uniform(0, 1, size) |