Python filter()函数

用于过滤序列,过滤掉不符合条件的元素。py2返回新列表,py3返回迭代器对象

filter(function, iterable)

接收两个参数,第一个为函数,第二个为可迭代对象,每个元素作为参数传递给函数进行判,然后返回 True 或 False

conda常用命令

查看conda环境

conda info -e

创建新的环境

conda create -n env_name

创建指定python版本的环境

conda create -n env_name python=x.x(2.7,3.5等)

移除环境

conda remove -n env_name –all

设置采用国内镜像

1、(临时方式)命令行conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --set show_channel_urls yes

2、(永久方式)Windows下C://Users/username/.condarc,Linux/Mac下~/.condarc,没有可以创建,修改内容如下

channels:
 - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 
 - defaults
show_channel_urls: yes