I have two lists
l1 = [[['Arsenal F.C.']],[['Chelsea F.C.']],[['FC Barcelona']], [['FC Barcelona'], ['NFL']],[['Formula E']], [['Formula E'], ['NBA']], [['Hashtag United F.C.']],[['India National Cricket Team']], [['J1 League']],[['Liverpool F.C.']],[['Manchester United F.C.']], [['Manchester United F.C.'], ['LaLiga']], [['Manchester United F.C.'], ['LaLiga'], ['Real Madrid C.F.']]]
l2 = [2, 1, 5, 1, 4, 1, 1, 2, 1, 1, 3, 1, 1]
l1 has the name of the teams together and l2 has the frequency of occurrence of each team. I want to visualize this with something like a bar chart where x axis has team names and y-axis has the respective frequencies.My code looks like following:
fig,ax = plt.subplots(figsize=(30,12))
_ = ax.set_title("combination searched")
_ = ax.bar(l1,l2)
_ = ax.set_xlabel("teams")
_ = ax.set_ylabel("No of times combination is searched")
plt.show()
I also wanted to get teams as xticks but I got error while plotting
I got the following Error:
TypeError: the dtypes of parameters x (object) and width (float64) are incompatible