I wanted to have no errors while using VSCode Pylance type checker.
How to type the axs
correctly in the following code:
import matplotlib.pyplot as plt
fig, axs = plt.subplots(2, 2)
In the image below, you can see that Pylance on VSCode is detecting an error.
CodePudding user response:
It turns out that strongly typing the axs
variable is not straightforward at all and requires to understant well how to type np.ndarray
.