Skip to content

Instantly share code, notes, and snippets.

View coderkd10's full-sized avatar
πŸ‘¨β€πŸ’»
building!

Abhishek Kedia coderkd10

πŸ‘¨β€πŸ’»
building!
View GitHub Profile
@coderkd10
coderkd10 / exception_traceback.py
Created October 11, 2018 13:55
python - printing exception traceback inside except block
import traceback
try:
# some possible exception causing functions / other block of code
raise ValueError("this is a demo exception")
except Exception as ex:
print("-- exception occured. traceback :")
traceback.print_tb(ex.__traceback__)
print(ex)
print("--------------------------------\n")
@coderkd10
coderkd10 / create_histogram.py
Created November 12, 2018 09:43
create a histogram using matplotlib
import matplotlib.pyplot as plt
fig, axes = plt.subplots()
axes.hist(list_to_plot_hist, bins='auto', alpha=0.9, rwidth=0.8)
axes.grid(axis='y', alpha=0.75)
plt.show()