降低版本
pip install Pillow==6.2.2 --user
import warnings
# 全部取消
warnings.filterwarnings("ignore")
# 部分取消
with warnings.catch_warnings():
warnings.simplefilter("ignore")
# your code
前者是标量,后者是矩阵
from bs4 import BeautifulSoup
raw_html ='示例'
soup = BeautifulSoup(raw_html ,'lxml')
fixed_html = soup.prettify()
print(fixed_html)
# '\n \n \n 示例\n \n \n'
vi /etc/hostname
git config --global core.quotepath false
安装Pyinstaller
进入需要打包的文件目录
pyinstaller -Fw file.py
# -w 不显示终端
# -F 将所有的库打包成一个文件
df = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3', 'K4', 'K5'],
'A': ['A0', 'A1', 'A2', 'A3', 'A4', 'A5']})
other = pd.DataFrame({'key': ['K0', 'K1', 'K2'],
'B': ['B0', 'B1', 'B2']})
df.join(other, on='key')
这是因为,参数中的on默认是在df和other两个数据框的index上,如果指定on=‘key’,则指定的仅是df数据框,other数据框还是以index为基础。
所以应该写成:
df.join(other.set_index('key'), on='key')
mongod --dbpath E:\MongoDB\data
找不同:
::输入的data格式(x,y,z),y列先不变。。。
np.set_printoptions(suppress=True,precision=3) # 不使用用科学计数法,保留三位小数
pd.set_option('display.float_format',lambda x : '%.4f' % x) # 保留小数点后4位有效数字
plt.rcParams['font.family'] = ['sans-serif'] #显示中文标签
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus']=False
import pandas as pd
from scipy import io
dataset = scipy.io.loadmat('.mat文件路径')
data = dataset['数据名'] # 可以通过查看dataset获取数据名
dfdata = pd.DataFrame(data)
执行命令:
conda install git
我是红色
效果:我是红色
# 需要与画图命令放在一个Cell中
sns.set_style({'font.sans-serif':['simhei', 'Arial']})
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 库名
pip install -i https://pypi.douban.com/simple 库名
-c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
找到对应版本下载
再执行下载命令
pip install L:\download\Twisted-20.3.0-cp38-cp38-win32.whl
install后跟完整路径
在默认路径下创建:.\anaconda3\envs
conda create -n env_name python=3.6
删除虚拟环境
conda remove -n env_name --all
指定安装路径
conda create --prefix=L:\your\path python=3.6
删除指定路径下的虚拟环境
conda remove --prefix=L:\your\path --all
激活虚拟环境后执行
conda install nb_conda
dataset.iloc[ : , : 1 ] # 返回一个多×1维的数组
dataset.iloc[ : , 0 ] # 返回一个一维数组
np.column_stack((a,b)) # 行数相同