有谁喜欢Python,说说Python的好处?
版主: hci
-
- 论坛元老
Caravel 的博客 - 帖子互动: 517
- 帖子: 23682
- 注册时间: 2022年 7月 24日 17:21
-
- 论坛支柱
2024年度优秀版主
TheMatrix 的博客 - 帖子互动: 260
- 帖子: 13138
- 注册时间: 2022年 7月 26日 00:35
#11 Re: 有谁喜欢Python,说说Python的好处?
Python的矩阵非常简洁,其他语言需要双重循环的对各个元素操作的,Python一句搞定,比如 A[A>=threshold] = 1之类。
另外它的indexing很好玩,变幻无穷,有点考脑力。
另外它的indexing很好玩,变幻无穷,有点考脑力。
#12 Re: 有谁喜欢Python,说说Python的好处?
这是numpy吧。确实如果没有numpy的话,python用处会小很多。libaliu 写了: 2025年 4月 1日 21:10 Python的矩阵非常简洁,其他语言需要双重循环的对各个元素操作的,Python一句搞定,比如 A[A>=threshold] = 1之类。
另外它的indexing很好玩,变幻无穷,有点考脑力。
#14 Re: 有谁喜欢Python,说说Python的好处?
开发效率最高,加参方便, json,字典,对象转换灵活
唯一不好,只能单线程,真的并行得multiprocess,或者靠底层的库。本身不适合做高性能应用。
唯一不好,只能单线程,真的并行得multiprocess,或者靠底层的库。本身不适合做高性能应用。
#16 Re: 有谁喜欢Python,说说Python的好处?
YouTube spent several years migrating their python to c++. Why: no good multi thread support, unpredictable performance, unmaintainable code, less infrastructure library support, etc.
On the other hand, machine learning has a small code base. Even the large model has very small number lines of code. All needed is fast numeric computation which is written in c++. So all the requirements for server development don't matter much. The only requirement is easy to change for fast iteration.
On the other hand, machine learning has a small code base. Even the large model has very small number lines of code. All needed is fast numeric computation which is written in c++. So all the requirements for server development don't matter much. The only requirement is easy to change for fast iteration.
x2
