I have a following problem. I have these data:
import pandas as pd, numpy as np
data = pd.DataFrame(
{
"year": [2000, 2001, 2001, 2001, 2002, 2003, 2004, 2005, 2006, 2007],
"week": [0, 1, 2, 2, 3, 3, 4, 5, 6, 7],
"value": [8, 1, 53, 2, 55, 3, 4, 55, 60, 76],
}
)
Then I plot the data week_groups = data.groupby([data["year"], data["week"]])["value"].count()
Now I would like to add a vertical line in (2004, 4). I try plt.axvline(x=(2004, 4)) but I got an Error ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all().
This does not help either:
plt.axvline(data["year"][np.where(np.array(data["year"]) == 2004)[0][0]])
week_groups.plot(kind="bar", figsize=(10, 5))
plt.show()
How can I fix it please?

plt.axvline(x=str((2020, 20)))