NumPy
NumPy is a library that extends the base capabilities of python to add a richer data set including mroe numeric types, vectors, matrices, and many matrix functions.
NumPy is a library that extends the base capabilities of python to add a richer data set including mroe numeric types, vectors, matrices, and many matrix functions.
类似于C的printf和scanf,Python也支持字符串的格式化输出。但是,Python格式化字符串的能力更强,因为格式化实际上是Python的string对象的内置函数,而该函数的返回值是格式化后的字符串。换句话说,Python的格式化字符串操作产生一个新的字符串,而该字符串就是个string对象。Python格式化字符串常用的运算符/函数是%和format
与C++一样,Python中也存在浅拷贝(Copy)和深拷贝(Deepcopy)两种拷贝方式。然而,由于Python中的一切传递、赋值都是引用,其深浅拷贝也具有更为不同的特点。
zip() aggregates elements from two or more iterables and return a iterator whose elements are tuples.
math.gamma() calculates generalized factorial.
An anonymous function in Python is the one that has no name when it is defined. In Python, the lambda keyword is used to define anonymous functions rather than the def keyword, which is used for normal functions.
一些安装Python包的注意事项。
* and **
The with statement in Python is used for resource management and exception handling. It is commonly used when working with file streams. However, we can also create our own context manager classes or context manager functions.
The iterator and generator are important objects in Python.