1 | # build stage |
星号操作符
函数
正则模块re
lambda函数
【转载】站在人生的十字路口,该怎么做选择?
文/雨令
有的人在十年前买了好几套房,结果成了千万富翁,有的人在前几年进了股市,结果却一贫如洗。
有的人顺风顺水步步高升一路躺赢,也有的人忙忙碌碌东奔西走依然举步维艰。
每个人一路走来,都在做着这样或那样的选择,你选择上学,他选择出国,你选择上班,他选择创业,那些看似不经意的选择,总是会在往后很长的一段时间里左右着我们的命运起伏。
2022年终总结与来年规划
今天是大年初一,虽然一个多礼拜没洗澡了,但身上的水痘好多了,趁着有大块的空闲时间,来写写年终总结。
OrderedDict和dict区别
Some differences from dict still remain:
- The regular dict was designed to be very good at mapping operations. Tracking insertion order was secondary.
- The OrderedDict was designed to be good at reordering operations. Space efficiency, iteration speed, and the performance of update operations were secondary.
- The OrderedDict algorithm can handle frequent reordering operations better than dict. As shown in the recipes below, this makes it suitable for implementing various kinds of LRU caches.
- The equality operation for OrderedDict checks for matching order.
collections模块
一.Counter计数
1.查询某元素出现次数、查询出现此次最多的n个元素
1 | from collections import Counter |