![]() S coping through making sure that the names of objects are unique and don’t clash.Īn important tool used by developers and data scientists is virtual environments. R eusability to avoid duplicating lines of code. M aintainability in making it easier to update a programme, which is less likely to break with small changes. Simplicity in breaking down a larger programme into steps. The advantage of modularising a larger application is: NumPy (comprehensive mathematics) and pandas (data analysis and manipulation using dataframes - a useful type of table) are also often referred to as libraries, due to their wide-ranging applications. Some that you will likely come across in the context of data science are Matplotlib (for generating visualisations) Beautiful Soup (for gathering data from the web), and sci-kit-learn (for machine learning). ![]() There are literally THOUSANDS of useful libraries available. However, it is often assumed that while a package is a collection of modules, a library is a collection of packages. In practice, this term is often used interchangeably with “python package” because packages can also contain modules and other packages (sub-packages). Usually, a python library is a collection of both modules and packages. ![]() Whilst modules and packages have specific definitions, a library is an umbrella term referring to a reusable chunk of code. Modular programming: The process of breaking down a large programming task into small, separate, manageable chunks or modules. Typically accessed with import statement, in the current directory. A module can define functions, classes, and variables. Modules: A file consisting of Python code. It's possible to put several modules into a single package. Packages: A directory with python files (modules) and a file with the name _init_.py. Just like we organise our files and documents on our computer into folders and subfolders, we can organize our modules into packages. Modules allow us to be well organised, grouping related code saved in a file with the extension “.py”. Packages and Modules are two mechanisms that facilitate modular programming in python. When a module from an external package is required in a program, that package can be imported and its modules can be used. Modules that are related to each other are mainly put in the same package. This post will summarise the key terms in working with packages, how conda and pip can work (and not work) together.Ī python package is a collection of modules. It allows you to install and manage additional packages that are not part of the Python Package Index ( PyPI). Pip is the standard package manager for python, meaning you can use it both inside and outside of Anaconda. In introductory data science and python courses, you will often work with Jupyter, loaded through Anaconda Navigator ( Check out this post for a visual explanation of how these fit together).īuilt into Anaconda, conda is a powerful package manager and environment manager that you use with command-line in the Anaconda Prompt for Windows, or in a terminal window for macOS or Linux. When getting started with programming it can be difficult to understand how we install and work with packages using the multiple tools at our disposal.
0 Comments
Leave a Reply. |