'numpy.ndarray' object has no attribute 'find' while trying to generate boxplot?
<p>I am trying to generate a box plot. Here is my code, data below:</p>

<pre><code>def loadData(fileName):
 data = pd.read_csv(fileName, quotechar='"')
    cols = data.columns.tolist()

    cols = cols[1:] + [ cols[0] ]
    data = data[cols]
    return data.values

cols={}
cols['close/last']=0
cols['volumne']=1
cols['open']=2
cols['high']=3
cols['low']=4
cols['date']=5

fileName = 'microsoft.csv'

def boxplot():
    data1 = loadData(fileName)
    ithattr1 = cols['high']
    ithattr2 = cols['close/last']
    dataset1 = data1[:,ithattr1]
    dataset2 = data1[:,ithattr2]

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.boxplot([dataset1,dataset2])
    plt.show()


boxplot()
</code></pre>

<p>The data is float which is verified by the print command as its output is
<code>&lt;type 'float'&gt;</code>. On running the code, I am getting the following error (full stacktrace below)</p>

<p><code>AttributeError: 'numpy.ndarray' object has no attribute 'find'</code></p>

<p>My data (e.g. in <code>dataset1</code>) looks like this</p>

<pre><code>[52.21 52.2 52.44 52.65 52.33 51.58 51.38 51.68 51.97 53.4163 54.07 53.1
 52.85 53.28 53.485 54.4001 55.39 54.8 56.19 56.78 56.85 55.95 55.96 55.88
 55.48 55.35 56.0 56.79 56.245 55.9 55.21 55.1 55.655 55.87 56.1 55.97
.........................................
 27.54 27.66 28.02 28.05 27.97 28.19 28.13]
</code></pre>

<p>output of <code>data.shape</code> = <code>(756,)</code></p>

<h3>Data file format:</h3>

<pre><code>2016/01/29,97.3400,64332440.0000,94.7900,97.3400,94.3500
2016/01/28,94.0900,55622370.0000,93.7900,94.5200,92.3900
2016/01/27,93.4200,133059000.0000,96.0400,96.6289,93.3400
2016/01/26,99.9900,71937310.0000,99.9300,100.8800,98.0700
2016/01/25,99.4400,51529980.0000,101.5200,101.5300,99.2100
</code></pre>

<h3>Stacktrace</h3>

<pre><code>Traceback (most recent call last):
  File "plot_curves.py", line 100, in &lt;module&gt;
    boxplot()
  File "plot_curves.py", line 96, in boxplot
    ax.boxplot([dataset1,dataset2])
  File "/home/rohit/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 3118, in boxplot
    manage_xticks=manage_xticks)
  File "/home/rohit/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 3480, in bxp
    flier_x, flier_y, **final_flierprops
  File "/home/rohit/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 3361, in doplot
    return self.plot(*args, **kwargs)
  File "/home/rohit/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 1373, in plot
    for line in self._get_lines(*args, **kwargs):
  File "/home/rohit/anaconda/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 304, in _grab_next_args
    for seg in self._plot_args(remaining, kwargs):
  File "/home/rohit/anaconda/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 263, in _plot_args
    linestyle, marker, color = _process_plot_format(tup[-1])
  File "/home/rohit/anaconda/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 85, in _process_plot_format
    if fmt.find('--') &gt;= 0:
AttributeError: 'numpy.ndarray' object has no attribute 'find'
</code></pre>

<p>Does anybody have any idea, how to resolve it?</p>