始め
2018.03.19
Q: 小白搭车问,先刷了 A 大的 opboot 的官改固件,再刷 breed 的官改固件,会如何?
A: 没有任何区别,opboot 也还是 opboot,不会有 breed,用 opboot 刷 breed 版本,会把 breed 给掐掉!相反也是一样!
2017.08.20
Q: 在 CentOS 上用 nohup 后台运行 .py 时出现:
nohup: ignoring input and appending output to 'nohup.out'
That's not an error - it's normal behavior. It just informs you that once started the in/output is removed from your console.
A: 程序无法在后台运行。要该提示信息不出现,可以这样运行:
nohup python3.6 app.py </dev/null &>/dev/null &
2017.08.08 Pandas Matplotlib 中文显示 (macOS)
# Run
import matplotlib
matplotlib.matplotlib_fname()
# Return
/usr/local/lib/python3.6/site-packages/matplotlib/mpl-data/matplotlibrc
- 进入上面显示的文件夹
- 打开终端运行 rm -rf /Users/用户名/.matplotlib/fontList.cache 清除缓存
- 下载 SimHei 字体,重命名为 SimHei.ttf,然后将其放入 fonts/ttf 文件夹内
- 打开 matplotlibrc 文件,在末尾添加一行 font.sans-serif: SimHei
2017.08.08 Pandas 重命名单个列
# Rename $a to a
# print(df.columns.values[0])
# $a
df.columns.values[0] = 'a'
# OR
df.rename(columns = {'$a': 'a'}, inplace = True)
2017.08.08 Pandas 切片转化为列表
# 将名为 close 的列转化为 list
# print(df.loc[:, 'close'])
# <class 'pandas.core.series.Series'>
df.loc[:, 'close'].tolist()