common package and module in Python
Python is a popular programming language that is widely used for various applications. It is a general-purpose language that can be used for web development, data analysis, artificial intelligence, machine learning, and many other areas. In Python, there are many built-in modules and packages that make it easy to perform various tasks. In this article, we will discuss some of the common packages and modules in Python.
NumPy is a popular package in Python that is used for scientific computing. It provides a high-performance multidimensional array object and tools for working with these arrays. NumPy is used for numerical computations, such as linear algebra, Fourier transforms, and random number generation. It is also used for data analysis and data visualization.
Pandas is another popular package in Python that is used for data analysis. It provides data structures for efficiently storing and manipulating large datasets. Pandas is used for data cleaning, data transformation, and data analysis. It also provides tools for data visualization, such as plotting and graphing.
Matplotlib is a plotting library in Python that is used for creating visualizations. It provides a wide variety of plots, such as line plots, scatter plots, bar plots, and histograms. Matplotlib is used for data visualization in various fields, such as science, engineering, finance, and economics.
- command line：click, argparse
- external command：subprocess, sh
- file copy：shutil
import shutil # Copy src to dst. (cp src dst) shutil.copy(src, dst) # Copy files, but preserve metadata (cp -p src dst) shutil.copy2(src, dst) # Copy directory tree (cp -R src dst) shutil.copytree(src, dst) # Move src to dst (mv src dst) shutil.move(src, dst)