Skip to content

Commit 87fd163

Browse files
committed
using explicit copy() to get around view/slice warning.
1 parent 7bf58e3 commit 87fd163

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_addplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,13 @@ def test_addplot10(bolldata):
331331

332332
def test_addplot11(bolldata):
333333

334-
df = bolldata.iloc[50:130,]
334+
df = bolldata[50:130].copy()
335335

336336
fname = base+'11.png'
337337
tname = os.path.join(tdir,fname)
338338
rname = os.path.join(refd,fname)
339339

340-
df['trend'] = 0
340+
df.loc[:,'trend'] = 0
341341
df.loc[df['Close'] < df['Open'], 'trend'] = - 1
342342
df.loc[df['Close'] > df['Open'], 'trend'] = 1
343343
ap = mpf.make_addplot(df['trend'],panel=1,type='step',ylabel='simple trend')

0 commit comments

Comments
 (0)