The Normalized Difference Vegetation Index (NDVI) is a simple graphical indicator that can be used to analyze remote sensing measurements, typically, but not necessarily, from a space platform, and assess whether the target being observed contains live green vegetation or not. NDVI value ranges between -1.0 and +1.0. Generally speaking, NDVI shows a functional relationship with vegetation properties (e.g. biomass). NDVI is directly related to the photosynthetic capacity and energy absorption of plant canopies. The NDVI is calculated from these individual measurements as follows:
NDVI= (NIR-Red) \ (NIR+Red)
This code is based on the jupyter notebook
Follow the link for all detail information with the code