
python
Intelligebce
这个作者很懒,什么都没留下…
展开
-
python Lambda表达式和嵌套if-else
一、语法lambda <arguments> : <value_1> if <condition_1> else (<value_2> if <condition_2> else <value_3>)二、案例x = lambda n: n if n%10 == 0 else ( n**2 if n%2 == 0 else n**3 )print(x(4))print(x(3))print(x(10))16原创 2021-09-25 14:31:55 · 7975 阅读 · 0 评论 -
python函数学习
#pandas.DataFrame.mergepandas.DataFrame.merge = merge(self, right, how=‘inner’, on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=(’_x’, ‘_y’), copy=True...原创 2020-02-19 18:29:03 · 580 阅读 · 0 评论 -
ERROR: Could not find a version that satisfies the requirement pandas>=0.25 (fro m osmnx) (from vers
ERROR: Could not find a version that satisfies the requirement pandas>=0.25 (fro m osmnx)解决方法:通过降低osmnx的包版本安装成功原创 2019-12-31 01:09:06 · 6146 阅读 · 0 评论 -
python安装拓展包
使用pip安装拓展包pip install package-namepip install -i 镜像地址 package-name常用的镜像地址有:清华:https://pypi.tuna.tsinghua.edu.cn/simple阿里云:http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc....原创 2019-12-30 22:01:42 · 647 阅读 · 0 评论 -
将jupyter notebook 启动浏览器指定为chorm(谷歌)
一、查看配置文件的位置二、修改配置文件import webbrowserwebbrowser.register('chrome', None, webbrowser.GenericBrowser(u'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe'))c.NotebookApp.browser = 'chrom...原创 2019-02-18 16:43:56 · 4198 阅读 · 0 评论 -
python中内置函数
1、enumerate函数描述:enumerate() 函数用于将一个可遍历的数据对象(如列表、元组或字符串)组合为一个索引序列,同时列出数据和数据下标,一般用在 for 循环当中。格式: enumerate(sequence, [start=0]) sequence -- 一个序列、迭代器或其他支持迭代对象。 start -- 下标起始位置(返回的枚举对象中下标开始位置)...原创 2018-12-13 18:15:41 · 335 阅读 · 0 评论 -
python numpy 学习笔记
结构数组一、创建结构数组 (1)、通过字典创建 键names对应字段列表 键formats对应字段类型列表 当参数align=True时, persontype = np.dtype({ 'names' : ['name, 'age', 'weight'], 'formats' : ['S32', 'i', 'f'] }, al...原创 2018-12-13 17:50:23 · 443 阅读 · 1 评论 -
python面向对象编程
一、python和java的区别原创 2018-11-29 13:28:42 · 199 阅读 · 0 评论 -
最简单解决Python安装拓展包问题:unable to find vcvarsall.bat
一、问题描述(1)、 电脑配置信息:win7系统TMD GCCPython3.5.x(2)使用pip命令安装mysqlclient时报错 error:unable to find vcvarsall.bat我的电脑上安装了TMD GCC但是却i没有vcvarsall.bat这个批处理文件。但是每次安装包都是出现error:unable to find vcv...原创 2018-11-17 11:37:06 · 1440 阅读 · 0 评论