import matplotlib as plt
for label in (tel_data.columns):
plt.hist(tel_data[tel_data[‘class’]==’g’][label].colors=’red’, label=’gamma’,alpha=0.5, density=’True’)
plt.hist(tel_data[tel_data[‘class’]==’h’][label].colors=’blue’, label=’hadron’,alpha=0.5, density=’True’)
plt.title(label)
plt.ylabel(“probabllity”)
plt.xlabel(label)
plt.legend()
tre=plt.show()
print(tre)
File “”, line 3
plt.hist (tel_data[tel_data[‘class’]==’g’][label].colors=’red’, label=’gamma’,alpha=0.5, density=’True’)
^
SyntaxError: keyword can’t be an expression
I was trying to import a histogram to visualize a data so typed this code but it says that (File “”, line 3
plt.hist (tel_data[tel_data[‘class’]==’g’][label].colors=’red’, label=’gamma’,alpha=0.5, density=’True’)
^
SyntaxError: keyword can’t be an expression).So I need a solution for this please.
S .HARISH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1