示例#1
0
    def call_cdf(self, other_args: List[str]):
        """Process cdf command"""
        parser = argparse.ArgumentParser(
            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
            add_help=False,
            prog="cdf",
            description="""
                Cumulative distribution function
            """,
        )
        parser.add_argument(
            "--export",
            choices=["csv", "json", "xlsx"],
            default="",
            type=str,
            dest="export",
            help="Export dataframe data to csv,json,xlsx file",
        )

        try:
            ns_parser = parse_known_args_and_warn(parser, other_args)
            if not ns_parser:
                return

            qa_view.display_cdf(
                name=self.ticker,
                df=self.stock,
                target=self.target,
                export=ns_parser.export,
            )

        except Exception as e:
            print(e, "\n")
 def call_cdf(self, other_args: List[str]):
     """Process cdf command"""
     parser = argparse.ArgumentParser(
         formatter_class=argparse.ArgumentDefaultsHelpFormatter,
         add_help=False,
         prog="cdf",
         description="""
             Cumulative distribution function
         """,
     )
     ns_parser = parse_known_args_and_warn(
         parser, other_args, export_allowed=EXPORT_ONLY_RAW_DATA_ALLOWED)
     if ns_parser:
         qa_view.display_cdf(
             name=self.ticker,
             df=self.df,
             target=self.target,
             export=ns_parser.export,
         )