Facing issue with a Kaggle python exercise
Hi! I'm getting this error for the following Kaggle python exercise... Any thoughts? thanks
/tmp/ipykernel_33/3599585355.py:17: UserWarning: FixedFormatter should only be used together with FixedLocator graph.set_yticklabels(new_labels)
def prettify_graph(graph):
graph.set_title("Results of 500 slot machine pulls")
# Make the y-axis begin at 0
graph.set_ylim(bottom=0)
# Label the y-axis
graph.set_ylabel("Balance")
# Bonus: format the numbers on the y-axis as dollar amounts
# An array of the values displayed on the y-axis (150, 175, 200, etc.)
ticks = graph.get_yticks()
# Format those values into strings beginning with dollar sign
new_labels = ['${}'.format(int(amt)) for amt in ticks]
# Set the new labels
graph.set_yticklabels(new_labels)
graph = jimmy_slots.get_graph()
prettify_graph(graph)
graph
3
3 comments
Sreenath Mavanoor
3
Facing issue with a Kaggle python exercise
Data Alchemy
skool.com/data-alchemy
Your Community to Master the Fundamentals of Working with Data and AI — by Datalumina®
Leaderboard (30-day)
powered by