国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

List comprehension

2019-11-14 10:54:18
字體:
來源:轉載
供稿:網友

List ComPRehension

from: http://www.bogotobogo.com/python/python_list_comprehension.php

List comprehension

if - for

[24.0 for x in xrange(len(df)) if df[x] > 24.0]

if - else - for [24.0 if df[x] > 24.0 else df[x] for x in xrange(len(df))]

Example Order['twenfour'] = [1.0 if ((Order.iloc[i,3] - Order.iloc[i,2]).total_seconds()) > delta else 0.0 for i in xrange(len(Order))]

tips: List comprehension run at C Speed inside the interpreter, so it is much faster than for loop. However, for loops make logic more explicit.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 兴国县| 玉门市| 金川县| 霍林郭勒市| 牟定县| 来宾市| 大邑县| 沛县| 无棣县| 侯马市| 同心县| 林甸县| 沾益县| 黎城县| 白河县| 修武县| 淮北市| 库伦旗| 盐源县| 绥滨县| 巧家县| 紫金县| 延庆县| 霍山县| 榆中县| 拜城县| 旬阳县| 中宁县| 台湾省| 精河县| 谢通门县| 卢氏县| 镇巴县| 晋宁县| 铜梁县| 平度市| 衡山县| 衡山县| 江陵县| 应城市| 曲麻莱县|