- 方法1,使用Python merge 在使用Excel时,我用的最多函数就是vlookup;在使用SQL查询的时候,我用的最多应该是join;这两个都有相同的功能,将多表匹配、合并,然后达到对比、查漏等等效果。在pandas里面也有类似的功能函数就是pd.merge()。merge的用法跟SQL中join很像。
https://zhuanlan.zhihu.com/p/30113030
- 方法2,使用{}返回匹配的整行.
diff --git a/themes/font/font.theme.sh b/themes/font/font.theme.sh | |
index c691e57..5a9dcc3 100644 | |
--- a/themes/font/font.theme.sh | |
+++ b/themes/font/font.theme.sh | |
@@ -37,12 +37,23 @@ THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:-"%I:%M:%S"} | |
VIRTUALENV_THEME_PROMPT_PREFIX='(' | |
VIRTUALENV_THEME_PROMPT_SUFFIX=') ' | |
+function _python_venv_prompt { |
import taichi as ti | |
ti.init(ti.gpu) | |
# global control | |
paused = ti.field(ti.i32, ()) | |
# gravitational constant 6.67408e-11, using 1 for simplicity | |
G = 1 | |
PI = 3.141592653 |
https://zhuanlan.zhihu.com/p/30113030
# -*- coding: utf-8 -*- | |
import logging | |
import os | |
import mysql.connector | |
import pandas as pd | |
logging.basicConfig(level=logging.DEBUG) | |
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |
with open("audioData_original.wav", 'wb') as of: | |
of.write(message['audio']) | |
audioFile = wave.open("audioData_original.wav", 'r') | |
n_frames = audioFile.getnframes() | |
audioData = audioFile.readframes(n_frames) | |
originalRate = audioFile.getframerate() | |
af = wave.open('audioData.wav', 'w') | |
af.setnchannels(1) | |
af.setparams((1, 2, 16000, 0, 'NONE', 'Uncompressed')) | |
converted = audioop.ratecv(audioData, 2, 1, originalRate, 16000, None) |
from flask import Flask, send_from_directory | |
app = Flask(__name__) | |
@app.route('/base/<path:filename>') | |
def base_static(filename): | |
return send_from_directory(app.root_path + '/../static/', filename) |
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common | |
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev | |
#Optional: so vim can be uninstalled again via `dpkg -r vim` | |
sudo apt-get install checkinstall | |
# use `which vim` to locate the vim directory first | |
sudo rm -rf /usr/local/share/vim /usr/bin/vim /usr/local/bin/vim |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
set runtimepath^=~/.vim/bundle/ctrlp.vim | |
" TUI 颜色设置 | |
" set termguicolors | |
" TUI 颜色设置,不然 vim-airline等着色不对 | |
"set t_Co=256 |