Message335704
| Author | rhettinger |
|---|---|
| Recipients | Windson Yang, francismb, rhettinger, steven.daprano |
| Date | 2019-02-16.17:44:35 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1550339075.39.0.98591180817.issue35892@roundup.psfhosted.org> |
| In-reply-to |
| Content | |
|---|---|
> We can return the smallest value from the **table** instead > of the code below. Internally, that does too much work and then throws most of it away. The difference between Counter(data).most_common()[1] and Counter(data).most_common(1) is that the former materializes the entire items iterator into a list and does a full sort, while the latter is memory friendly and makes a single pass with min(). |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-02-16 17:44:35 | rhettinger | set | recipients: + rhettinger, steven.daprano, francismb, Windson Yang |
| 2019-02-16 17:44:35 | rhettinger | set | messageid: <1550339075.39.0.98591180817.issue35892@roundup.psfhosted.org> |
| 2019-02-16 17:44:35 | rhettinger | link | issue35892 messages |
| 2019-02-16 17:44:35 | rhettinger | create | |