i am new to matploblib and numpy and have faced issues trying to extracting the data. the following codes results in IndexError: boolean index did not match indexed array along dimension 0; dimension is 32 but corresponding boolean dimension is 112. pls advise!!
dataset used: https://data.gov.sg/dataset/monthly-motor-vehicle-population-by-type-of-fuel-used
import numpy as np
import matplotlib.pyplot as plt
title = "motor-vehicle-population-statistics-by-type-of-fuel-used."
titlelen = len(title)
print("{:*^{titlelen}}".format(title, titlelen=titlelen+6))
print()
data = np.genfromtxt("data/motor-vehicle-population-statistics-by-type-of-fuel-used.csv",
dtype=("datetime64[Y]","U100","U110",int),
delimiter=",",
names=True)
years = np.unique(data["month"])
category = np.unique(data['category'])
type = np.unique(data['type'])
cars = data[data["category"]=="Cars"]["number"]
carspetrol = cars[data["type"]=="Petrol"]["number"]
# print(cars)
print(carspetrol)
IndexError: boolean index did not match indexed array along dimension 0; dimension is X but corresponding boolean dimension is Y), it means you are trying to do an operation which requires two arrays to have the same dimensions, but they don't.