mirror of
				https://github.com/kernc/backtesting.py.git
				synced 2024-01-28 15:29:30 +03:00 
			
		
		
		
	REF: Fix pandas deprecation warning (#725)
* REF: Fix pandas deprecation warning > FutureWarning: Passing method to Int64Index.getloc > Use index.get_indexer([item], method=...) instead. * Update backtesting/_plotting.py
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							d5db8bed50
						
					
				
				
					commit
					dfba4615e8
				
			@@ -145,7 +145,7 @@ def _maybe_resample_data(resample_rule, df, indicators, equity_data, trades):
 | 
			
		||||
            if s.size:
 | 
			
		||||
                # Via int64 because on pandas recently broken datetime
 | 
			
		||||
                mean_time = int(bars.loc[s.index].view(int).mean())
 | 
			
		||||
                new_bar_idx = new_index.get_loc(mean_time, method='nearest')
 | 
			
		||||
                new_bar_idx = new_index.get_indexer([mean_time], method='nearest')[0]
 | 
			
		||||
                return new_bar_idx
 | 
			
		||||
        return f
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user