Implement the [] operator for the gen_data class in GenData.py