Please be a bit more specific. You don't really "calculate" the band index, you specify it when e.g. computing a Bloch state, or you want to determine a particular energy in a list. So what you are looking for is a way to determine a particular index, with some property, for instance the one (for a given k-point) with the lowest positive energy (i.e. the lowest conduction band index at this k).
In order to avoid confusion if you are not used to Python programming, I would strongly recommend using the Bandstructure Analyzer in VNL and just put the mouse over the state of interest, to determine its band index.