ECOPOM as a research group of the University of Bologna (IT), with Prof. Manfrini and Mengoli giving lectures at the Master Degree course "Precision And Sustainable Agriculture (PASA)", engages students with thesis aiming at developing/testing new AgTech technologies for the Precision Orchard Management (POM).
To better comprehend those topics, a basic training on Python and automation is given to students. This repository contains the material needed to deepend in this context.
Install any Virtual Environment Manager (VEM) on your computer. The suggested VEM for beginners is Anaconda [Download].
If you are installing Anaconda, use the installer that better fits with your machine Operating System (OS) (i.e., Windows, MacOS, Linux, etc).
Note: to install Anaconda you'll be asked to register (it's free).
- surf to the following link
- Select your Operatoing System and follow the instructions
For Windows only:
When creating a virtual environment with Anaconda, Python gets directly installed inside each venv. If you are working with a different VEM such as venv you'll need to install Python by yourself.
Both Anaconda Navigator and Anaconda Prompt can be found in the START menù of your computer after the installation.
A. Create a venv using the Anaconda Navigator Graphic User Inteface (GUI) Here you can find a comprehensive documentation on how to use Anaconda Navigator based on your machine's OS.
B. Create a venv using the Anaconda Prompt [recommended]
Usually, Anaconda is referred to as conda
.
create the environment with the name you prefer
conda create --name <venv_name>
then activate it
conda activate <venv_name>
More documentation on create, update, remove, and export your conda environments could be found at the following link and in the Anaconda Cheat Sheet available in the folder docs.
Install an Integrated Development Environment that could be both a General Editor such as Visual Studio Code (vscode) or a Python-Specific Editor as PyCharm community edition. We encourage to use vscode since it supports many features, extension plugins and programming languages (Python, Java, R, C, C++, C#, and so on).
Here you can find some documentation on how to interact with the vscode user interface.
A. Open the GitHub repository click on <>Code
(the green appearing button in the screenshot below), then Local and Download ZIP
B. Surf to you Computer's Downloads folder, right click on AgTech_Students_PythonCourse-main.zip
file and extract the folder content into your Desktop.
Start vscode, the from menù file > Open folder... > Desktop/AgTech_Students_PythonCourse-main
Open the Anaconda Prompt, activate the venv and make sure you have pip
(Python package manager) installed:
conda list
if pip
or pip3
does not appear in the list of installed packages, do the following:
conda install pip
After all, from the Anaconda Prompt do the following:
# change directory to the repository folder
cd Desktop/AgTech_Students_PythonCourse-main
# install packages and modules with PIP
pip install -r requirements.txt
Note: the requirements are referring to Python version 3.10.12
You can either decide to use notebook materials with Jupyter Notebooks, which is native of anaconda, or by exploiting vscode jupyter plugin (recommended).
file | topic |
---|---|
00_ipynb_introduction.ipynb | Introduction to notebooks |
01_native_python_data_structures.ipynb | Introduction to Python variables and native data structures |
01_01_choosing_numerical_dtypes.ipynb | How to identify the proper numerical dtype |
02_python_operators.ipynb | Python operators: arithmentical, logical, comparative, bitwise, assignment, special |
03_numpy.ipynb | NumPy arrays |
04_pandas.ipynb | Pandas Dataframes |
05_introduction_to_images.ipynb | Image data introduction |