• 1403/08/25

درس 54 در رابطه با رنکو :

سلام :

در درس 54  این خطا وجود ندارد و نمی توانم رفع کنم . 

 

 

D:\python fo finance\finance\AT15 OBV_Renko.py:79: FutureWarning: Series.__getitem__ treating keys

 as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`

 df2.brick_size = max(0.5,round(ATR(DF,a,120)[-1],0))

D:\python fo finance\finance\AT15 OBV_Renko.py:84: ChainedAssignmentError: A value is trying to be set on a copy of a DataFrame or Series through chained assignment.

When using the Copy-on-Write mode, such chained assignment never works to update the original DataFrame or Series, because the intermediate object on which we are setting values always behaves as a copy.

 

Try using '.loc[row_indexer, col_indexer] = value' instead, to perform the assignment in a single step.

 

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

 renko_df[a+" bar_num"][i]+=renko_df[a+" bar_num"][i-1]

D:\python fo finance\finance\AT15 OBV_Renko.py:86: ChainedAssignmentError: A value is trying to be set on a copy of a DataFrame or Series through chained assignment.

When using the Copy-on-Write mode, such chained assignment never works to update the original DataFrame or Series, because the intermediate object on which we are setting values always behaves as a copy.

 

Try using '.loc[row_indexer, col_indexer] = value' instead, to perform the assignment in a single step.

 

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

 renko_df[a+" bar_num"][i]+=renko_df[a+" bar_num"][i-1]

Traceback (most recent call last):

 File "D:\python fo finance\finance\AT15 OBV_Renko.py", line 141, in <module>

   ohlc_renko = data1.merge(renko.loc[:,[a+' Date' , 'bar_num']] , how = 'outer' , on = a+' Date')

 File "D:\python fo finance\finance\lib\site-packages\pandas\core\frame.py", line 10832, in merge

   return merge(

 File "D:\python fo finance\finance\lib\site-packages\pandas\core\reshape\merge.py", line 170, in merge

   op = _MergeOperation(

 File "D:\python fo finance\finance\lib\site-packages\pandas\core\reshape\merge.py", line 807, in __init__

   self._maybe_coerce_merge_keys()

 File "D:\python fo finance\finance\lib\site-packages\pandas\core\reshape\merge.py", line 1512, in _maybe_coerce_merge_keys

   raise ValueError(msg)

ValueError: You are trying to merge on datetime64[ns, UTC] and object columns for key 'BTC-USD Date'. If you wish to proceed you should use pd.concat

 

Process finished with exit code 1

logo-samandehi