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 sys | |
import os | |
fnames = os.listdir('s1') | |
fnames.sort() | |
for fname in fnames: |
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
FROM python:3.7 | |
#RUN apt-get update && apt-get -y install vim && rm -rf /var/lib/apt/lists/* | |
WORKDIR /workspace | |
ENV PYTHONPATH /workspace | |
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone | |
#COPY requirements.txt /workspace/requirements.txt |
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
from sklearn.linear_model import LogisticRegression | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import classification_report | |
X = [] | |
y = [] | |
lines = open('data.csv').readlines() | |
for line in lines[1:]: | |
line = line.strip() | |
if not line: |
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
# ========================= | |
def ff(): | |
for i in range(4): | |
a = yield i | |
print('a:', a) | |
def gg(): | |
yield from ff() |
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 sqlalchemy | |
from sqlalchemy import Column, Integer, String | |
from sqlalchemy.ext.declarative import declarative_base | |
import pymysql | |
pymysql.install_as_MySQLdb() | |
#object(oop) ---> mysql(SQL) | |
#1). 创建数据库引擎(连接数据库的过程) | |
#echo=True显示翻译好的SQL语句。 | |
from sqlalchemy.orm import Session, sessionmaker |
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 | |
# -*- coding: utf-8 -*- | |
from sys import version_info | |
from base64 import b64encode, b64decode | |
from binascii import hexlify, unhexlify | |
__all__ = ['encrypt_ecb', 'decrypt_ecb', |
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
-- ! =============== 通用方法 ================== | |
func daily(table_name): | |
-- 每日统计加上周统计日字段 | |
( | |
SELECT | |
*, | |
CASE WHEN date_format(date(`日期`),'%w') < 5 | |
THEN subdate(date(`日期`), date_format(date(`日期`),'%w') -4 ) |
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
from cassandra.cluster import Cluster | |
from cassandra.query import SimpleStatement | |
cluster = Cluster(['taojy123.com']) | |
session = cluster.connect('taiqiyun') | |
query = "SELECT * FROM best" | |
statement = SimpleStatement(query, fetch_size=2) |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"net" | |
"github.com/Shopify/sarama" | |
) | |
var port = "10086" |
NewerOlder