title: Getting a weird error that says 'Reshape your data either using array.reshape(-1, 1)'
body: <p>I am testing this code.</p>
  
  <pre><code># Import the necessary packages
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import Normalizer
  from sklearn.cluster import KMeans
  # Define a normalizer
  normalizer = Normalizer()
  # Create Kmeans model
  kmeans = KMeans(n_clusters = 10,max_iter = 1000)
  # Make a pipeline chaining normalizer and kmeans
  pipeline = make_pipeline(normalizer,kmeans)
  # Fit pipeline to daily stock movements
  pipeline.fit(score)
  labels = pipeline.predict(score)
  </code></pre>
  
  <p>This line throws an error:</p>
  
  <pre><code>pipeline.fit(score)
  </code></pre>
  
  <p>Here is the error that I see:</p>
  
  <pre><code>Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
  </code></pre>
  
  <p>I don't know what this error means.  I Googled it and didn't find anything useful.  Here is a small sample of my data:  </p>
  
  <pre><code>array=[1. 1. 1. ... 8. 1. 1.].
  </code></pre>
  
  <p>I am following the example from the link below.</p>
  
  <p><a href="https://medium.com/datadriveninvestor/stock-market-clustering-with-k-means-clustering-in-python-4bf6bd5bd685" rel="nofollow noreferrer">https://medium.com/datadriveninvestor/stock-market-clustering-with-k-means-clustering-in-python-4bf6bd5bd685</a></p>
  
  <p>When I run the code from the link, everything works fine.  I'm not sure why it falls down when I run the code on my own data, which is just:</p>
  
  <pre><code>1, 1.9, 2.62, 3.5, 4.1, 7.7, 9.75, etc, etc.  
  </code></pre>
  
  <p>It goes from 1-10.  That's all it is.</p>