python - 如何使用行中执行的最后一个变量?就像 R (Python) 中的 %>%
问题描述
我是 Python 新手,我想知道是否有办法在同一代码行中使用最后一次执行。在 R 中,您可以使用管道 (%>%) 来做到这一点。
例如:
在 R 中,您可以这样做:
list(filter(lambda x: '_LI' not in x,BI.columns))) %>% list(filter(lambda x: '_LS' not in x,.)
这与以下内容相同:
list(filter(lambda x: '_LS' not in x,list(filter(lambda x: '_LI' not in x,BI.columns))))
最后一个在 Python 中运行良好,但我更喜欢第一种方式,我想在 Python 中做同样的事情。可能吗?
解决方案
推荐阅读
- r - 如何在 R 中使用 read.delim 读取包含交叉开关的列名
- python - 当我没有它的 id 时,如何使用 Selenium 与元素交互?
- reactjs - 当使用 create-react-app 启动 yarn start 时,服务器的文档根在哪里?
- sql - 如何正确使用光标
- node.js - Dialogflow 中的默认参数
- python - 重新评估/更新作为 Python 中的类变量传递的条件表达式的真值的最佳方法
- java - 对令牌感到困惑
- javascript - Laravel图像点击覆盖javascript
- r - 带有 maps() - R 的地理/地理空间地图
- maven - surefire 插件输出:“警告:发生了非法反射访问操作”