class_docstr: An object designed to perform optimisations based on minimising a cost/objective function.
  It can find parameters for portfolios with
  
  - minimum volatility
  - maximum Sharpe ratio
  - minimum volatility for a given target return
  - maximum Sharpe ratio for a given target volatility
  
  It also provides functions to compute the Efficient Frontier between a range
  of Returns, plot the Efficient Frontier, plot the optimal portfolios
  (minimum Volatility and maximum Sharpe Ratio).
class_docstr_tok: ["An","object","designed","to","perform","optimisations","based","on","minimising","a","cost\/objective","function",".","It","can","find","parameters","for","portfolios","with","-","minimum","volatility","-","maximum","Sharpe","ratio","-","minimum","volatility","for","a","given","target","return","-","maximum","Sharpe","ratio","for","a","given","target","volatility","It","also","provides","functions","to","compute","the","Efficient","Frontier","between","a","range","of","Returns",",","plot","the","Efficient","Frontier",",","plot","the","optimal","portfolios","(","minimum","Volatility","and","maximum","Sharpe","Ratio",")","."]
docstr: Finds the portfolio with the minimum volatility.
  
  :param save_weights: For internal use only, default: True
       Whether to save the optimised weights in the instance variable
       ``weights`` (and ``df_weights``). Useful for the case of computing
       the efficient frontier after doing an optimisation, else the optimal
       weights are overwritten by the efficient frontier computations.
       Best to ignore this argument.
  
  
  :rtype: :py:data:`~.finquant.data_types.ARRAY_OR_DATAFRAME`
  :return:
      - if ``save_weights`` is True:
          a DataFrame of weights/allocation of stocks within the optimised portfolio.
      - if ``save_weights`` is False:
          a ``numpy.ndarray`` of weights/allocation of stocks within the optimised portfolio.
docstr_tok: ["Finds","the","portfolio","with","the","minimum","volatility",".",":","param","save_weights",":","For","internal","use","only",",","default",":","True","Whether","to","save","the","optimised","weights","in","the","instance","variable","``","weights","``","(","and","``","df_weights","``",")",".","Useful","for","the","case","of","computing","the","efficient","frontier","after","doing","an","optimisation",",","else","the","optimal","weights","are","overwritten","by","the","efficient","frontier","computations",".","Best","to","ignore","this","argument",".",":","rtype",":",":","py",":","data",":","`","~.finquant.data_types.ARRAY_OR_DATAFRAME","`",":","return",":","-","if","``","save_weights","``","is","True",":","a","DataFrame","of","weights\/allocation","of","stocks","within","the","optimised","portfolio",".","-","if","``","save_weights","``","is","False",":","a","``","numpy.ndarray","``","of","weights\/allocation","of","stocks","within","the","optimised","portfolio","."]
code: def minimum_volatility(
      self, save_weights: bool = True
  ) -> ARRAY_OR_DATAFRAME[FLOAT]:
      """Finds the portfolio with the minimum volatility.
  
      :param save_weights: For internal use only, default: True
           Whether to save the optimised weights in the instance variable
           ``weights`` (and ``df_weights``). Useful for the case of computing
           the efficient frontier after doing an optimisation, else the optimal
           weights are overwritten by the efficient frontier computations.
           Best to ignore this argument.
  
  
      :rtype: :py:data:`~.finquant.data_types.ARRAY_OR_DATAFRAME`
      :return:
          - if ``save_weights`` is True:
              a DataFrame of weights/allocation of stocks within the optimised portfolio.
          - if ``save_weights`` is False:
              a ``numpy.ndarray`` of weights/allocation of stocks within the optimised portfolio.
      """
      # Type validations:
      type_validation(save_weights=save_weights)
  
      args = (self.mean_returns.values, self.cov_matrix.values)
  
      # Optimization
      result = sco.minimize(
          min_fun.portfolio_volatility,
          args=args,
          x0=self.x_0,
          method=self.method,
          bounds=self.bounds,
          constraints=self.constraints,
      )
  
      # Set the last optimization
      self.last_optimisation = "Minimum Volatility"
  
      # Set optimal weights
      if save_weights:
          self.weights = result["x"]
          self.df_weights = self._dataframe_weights(self.weights)
          return self.df_weights
      else:
          # not setting instance variables, and returning array instead
          # of pandas.DataFrame
          return result["x"]
  
imports: from typing import Any, Callable, Dict, List, Optional, Tuple, Union
  import matplotlib.pylab
  import numpy
  import pandas
  import scipy.optimize
  import finquant.minimise_fun
  from finquant.data_types import ARRAY_OR_DATAFRAME, ARRAY_OR_LIST, FLOAT, INT, NUMERIC
  from finquant.quants import annualised_portfolio_quantities
  from finquant.type_utilities import type_validation
label_desc: Use image node_id 2 for calling the EfficientFrontier obj's underlying member method code with example usage: obj.minimum_volatility(save_weights) and returns: self, result