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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
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
mongoexport --db mongo_db --collection gdtask_daily_stats --out gdtask_daily_stats.json |
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
#!/bin/bash | |
# install CUDA Toolkit v8.0 | |
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)) | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb" | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-get update | |
sudo apt-get -y install cuda |
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
db.gdtask_daily_stats_all_regions_summary.createIndex({"task_id":1, "Region":1},{ unique: true }) |
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 checkout - | |
或者 | |
git co - |
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
In [43]: df['Value'] = df.apply(lambda row: my_test(row['a'], row['c']), axis=1) | |
In [44]: df | |
Out[44]: | |
a b c Value | |
0 -1.674308 foo 0.343801 0.044698 | |
1 -2.163236 bar -2.046438 -0.116798 | |
2 -0.199115 foo -0.458050 -0.199115 | |
3 0.918646 bar -0.007185 -0.001006 | |
4 1.336830 foo 0.534292 0.268245 |
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
Settings -> Build Execution Deployment -> Console -> Python Console |
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
df.somecolumn = df.somecolumn.astype(int) |
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
What else can you do? | |
How to clone repository to a specific commit? (full clone) | |
# Create empty repository to store your content | |
git clone <url> | |
git reset <sha-1> --hard | |
More info: | |
How to clone single branch? |
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 datetime | |
d = '2017-10-16' | |
df = datetime.datetime.strptime(d, '%Y-%m-%d') | |
df | |
Out[6]: datetime.datetime(2017, 10, 16, 0, 0) | |
df = df - datetime.timedelta(days=1) | |
df | |
Out[8]: datetime.datetime(2017, 10, 15, 0, 0) | |
df.strftime('%Y-%m-%d') |