matplotlibでScatterを追加したが、エラーが出てしまいます。
コード
# plot the Finonacci levesl plt.figure(figsize=(18.495,14.25)) plt.plot(new_df.index, new_df['Close'],color='black') plt.scatter(new_df.index, new_df['Buy_Signal_Price'], color='green', alpha=1) # plt.scatter(new_df.index, new_df['Sell_Signal_Price'], color='red', alpha=1) plt.axhline(max_price, linestyle='--', alpha=0.5,color='green') plt.axhline(fist_level, linestyle='--', alpha=0.5,color='green') plt.axhline(secon_level, linestyle='--', alpha=0.5,color='green') plt.axhline(third_level, linestyle='--', alpha=0.5,color='green') plt.axhline(fourth_level, linestyle='--', alpha=0.5,color='green') plt.axhline(fifth_level, linestyle='--', alpha=0.5,color='green') plt.axhline(min_price, linestyle='--', alpha=0.5,color='green') plt.ylabel('Close Price in USD') plt.xlabel('Date') plt.xticks(rotation=45) plt.show()
エラー
TypeError Traceback (most recent call last) <ipython-input-12-e02e414dc72b> in <module> 5 plt.figure(figsize=(18.495,14.25)) 6 plt.plot(new_df.index, new_df['Close'],color='black') ----> 7 plt.scatter(new_df.index, new_df['Buy_Signal_Price'], color='green', alpha=1) 8 # plt.scatter(new_df.index, new_df['Sell_Signal_Price'], color='red', alpha=1) 9 ~\anaconda3\envs\crypto\lib\site-packages\matplotlib\pyplot.py in scatter(x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, hold, data, **kwargs) 3376 vmin=vmin, vmax=vmax, alpha=alpha, 3377 linewidths=linewidths, verts=verts, -> 3378 edgecolors=edgecolors, data=data, **kwargs) 3379 finally: 3380 ax._hold = washold ~\anaconda3\envs\crypto\lib\site-packages\matplotlib\__init__.py in inner(ax, *args, **kwargs) 1715 warnings.warn(msg % (label_namer, func.__name__), 1716 RuntimeWarning, stacklevel=2) -> 1717 return func(ax, *args, **kwargs) 1718 pre_doc = inner.__doc__ 1719 if pre_doc is None: ~\anaconda3\envs\crypto\lib\site-packages\matplotlib\axes\_axes.py in scatter(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, **kwargs) 4021 linewidths = rcParams['lines.linewidth'] 4022 -> 4023 offsets = np.column_stack([x, y]) 4024 4025 collection = mcoll.PathCollection( <__array_function__ internals> in column_stack(*args, **kwargs) ~\anaconda3\envs\crypto\lib\site-packages\numpy\lib\shape_base.py in column_stack(tup) 654 arr = array(arr, copy=False, subok=True, ndmin=2).T 655 arrays.append(arr) --> 656 return _nx.concatenate(arrays, 1) 657 658 <__array_function__ internals> in concatenate(*args, **kwargs) TypeError: invalid type promotion
エラーが出ている原因が分かりません。
どなたか教えていただけますでしょうか。
よろしくお願いいたします。
エラーメッセージは、質問に掲載してるのよりも下にもっと続いてませんでしょうか?
続いてたら、省略せずに全部掲載してください
(ここに書くのではなく、質問を編集して追記してください)
エラーメッセージを追加しました。
よろしくお願いいたします。
