Python Forum
Histogram and text file. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Histogram and text file. (/thread-18600.html)



Histogram and text file. - pawlo392 - May-23-2019

I have such a text file:
breast-cancer
I want to create a histogram and any other graph. Bu I have a problem. I wrote this:
import matplotlib.pyplot as plt
import numpy as np
from sklearn.datasets import load_svmlight_file
X, y = load_svmlight_file('breast-cancer.txt')
plt.hist(X,y)
And I get:
Error:
ValueError: `bins` must increase monotonically, when an array



RE: Histogram and text file. - heiner55 - May-24-2019

See https://stackoverflow.com/questions/44166763/bins-must-increase-monotonically