text
stringlengths
0
105k
import inspect import sys import typing as t from types import FrameType, ModuleType def _get_module_name_from_frame(frame: FrameType): return frame.f_globals["__name__"] if "__name__" in frame.f_globals else None def _get_module_name_from_imported_var(var_name: str, value: t.Any, sub_module_name: str...
# flake8: noqa: E402 import contextlib import typing as t import warnings from threading import Thread from urllib.parse import quote as urlquote from urllib.parse import urlparse warnings.filterwarnings( "ignore", category=UserWarning, message="You do not have a working installation of the serv...
import typing as t from operator import attrgetter if t.TYPE_CHECKING: from ..gui import Gui def _getscopeattr(gui: "Gui", name: str, *more) -> t.Any: if more: return getattr(gui._get_data_scope(), name, more[0]) return getattr(gui._get_data_scope(), name) def _getscopeattr_drill(g...
from __future__ import annotations import typing as t from .._warnings import _warn from ..icon import Icon from . import _MapDict class _Adapter: def __init__(self): self.__adapter_for_type: t.Dict[str, t.Callable] = {} self.__type_for_variable: t.Dict[str, str] = {} self._...
import typing as t def _get_css_var_value(value: t.Any) -> str: if isinstance(value, str): if " " in value: return f'"{value}"' return value if isinstance(value, int): return f"{value}px" return f"{value}"
import typing as t from types import ModuleType from ..page import Page def _get_page_from_module(module: ModuleType) -> t.Optional[Page]: return next((v for v in vars(module).values() if isinstance(v, Page)), None)
from __future__ import annotations import typing as t if t.TYPE_CHECKING: from ..gui import Gui def _varname_from_content(gui: Gui, content: str) -> t.Optional[str]: return next((k for k, v in gui._get_locals_bind().items() if isinstance(v, str) and v == content), None)
from __future__ import annotations import contextlib import typing as t from flask import g class _LocalsContext: __ctx_g_name = "locals_context" def __init__(self) -> None: self.__default_module: str = "" self._lc_stack: t.List[str] = [] self._locals_map: t.Dict[str, ...
from ._attributes import ( _delscopeattr, _getscopeattr, _getscopeattr_drill, _hasscopeattr, _setscopeattr, _setscopeattr_drill, ) from ._locals_context import _LocalsContext from ._map_dict import _MapDict from ._runtime_manager import _RuntimeManager from ._variable_directory import...
import re import typing as t __expr_var_name_index: t.Dict[str, int] = {} _RE_NOT_IN_VAR_NAME = r"[^A-Za-z0-9]+" def _get_expr_var_name(expr: str) -> str: var_name = re.sub(_RE_NOT_IN_VAR_NAME, "_", expr) index = 0 if var_name in __expr_var_name_index.keys(): index = __expr_var_name_in...
import socket def _is_port_open(host, port) -> bool: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) result = sock.connect_ex((host, port)) sock.close() return result == 0
import json import typing as t from abc import ABC from datetime import datetime from .._warnings import _warn from . import _date_to_string, _MapDict, _string_to_date, _variable_decode class _TaipyBase(ABC): __HOLDER_PREFIXES: t.Optional[t.List[str]] = None _HOLDER_PREFIX = "_Tp" def __ini...
import sys def is_debugging() -> bool: """NOT DOCUMENTED""" return hasattr(sys, "gettrace") and sys.gettrace() is not None
import typing as t def _is_boolean_true(s: t.Union[bool, str]) -> bool: return ( s if isinstance(s, bool) else s.lower() in ["true", "1", "t", "y", "yes", "yeah", "sure"] if isinstance(s, str) else False ) def _is_boolean(s: t.Any) -> bool: if isinst...
_replace_dict = {".": "__", "[": "_SqrOp_", "]": "_SqrCl_"} def _get_client_var_name(var_name: str) -> str: for k, v in _replace_dict.items(): var_name = var_name.replace(k, v) return var_name def _to_camel_case(value: str, upcase_first=False) -> str: if not isinstance(value, str): ...
import re import typing as t from .._warnings import _warn from .boolean import _is_boolean, _is_boolean_true from .clientvarname import _to_camel_case def _get_column_desc(columns: t.Dict[str, t.Any], key: str) -> t.Optional[t.Dict[str, t.Any]]: return next((x for x in columns.values() if x.get("dfid")...
import typing as t from datetime import datetime from random import random from ..data.data_scope import _DataScopes from ._map_dict import _MapDict if t.TYPE_CHECKING: from ..gui import Gui class _Bindings: def __init__(self, gui: "Gui") -> None: self.__gui = gui self.__scopes...
import re import typing as t from types import FrameType from ._locals_context import _LocalsContext from .get_imported_var import _get_imported_var from .get_module_name import _get_module_name_from_frame, _get_module_name_from_imported_var class _VariableDirectory: def __init__(self, locals_context: ...
from typing import Dict class _Singleton(type): _instances: Dict = {} def __call__(self, *args, **kwargs): if self not in self._instances: self._instances[self] = super(_Singleton, self).__call__(*args, **kwargs) return self._instances[self]
from __future__ import annotations import ast import builtins import re import typing as t from .._warnings import _warn if t.TYPE_CHECKING: from ..gui import Gui from . import ( _get_client_var_name, _get_expr_var_name, _getscopeattr, _getscopeattr_drill, _hasscopeattr, ...
import re import pandas as pd def _get_data_type(value): if pd.api.types.is_bool_dtype(value): return "bool" elif pd.api.types.is_integer_dtype(value): return "int" elif pd.api.types.is_float_dtype(value): return "float" return re.match(r"^<class '(.*\.)?(.*?)(\d\d...
import ast import inspect import typing as t from types import FrameType def _get_imported_var(frame: FrameType) -> t.List[t.Tuple[str, str, str]]: st = ast.parse(inspect.getsource(frame)) var_list: t.List[t.Tuple[str, str, str]] = [] for node in ast.walk(st): if isinstance(node, ast.Imp...
import re import typing as t from datetime import date, datetime, time from dateutil import parser from pytz import utc from .._warnings import _warn def _date_to_string(date_val: t.Union[datetime, date, time]) -> str: if isinstance(date_val, datetime): # return date.isoformat() + 'Z', if po...
from importlib import util def _is_in_notebook(): # pragma: no cover try: if not util.find_spec("IPython"): return False from IPython import get_ipython ipython = get_ipython() if ipython is None or "IPKernelApp" not in ipython.config: retur...
import typing as t from pathlib import Path def _get_non_existent_file_path(dir_path: Path, file_name: str) -> Path: if not file_name: file_name = "taipy_file.bin" file_path = dir_path / file_name index = 0 file_stem = file_path.stem file_suffix = file_path.suffix while file...
import re import typing as t _RE_PD_TYPE = re.compile(r"^([^\s\d\[]+)(\d+)(\[(.*,\s(\S+))\])?") def _get_date_col_str_name(columns: t.List[str], col: str) -> str: suffix = "_str" while col + suffix in columns: suffix += "_" return col + suffix
import typing as t import numpy import pandas as pd from ..gui import Gui from .data_format import _DataFormat from .pandas_data_accessor import _PandasDataAccessor class _NumpyDataAccessor(_PandasDataAccessor): __types = (numpy.ndarray,) @staticmethod def get_supported_classes() -> t.Lis...
import typing as t import pandas as pd from ..gui import Gui from ..utils import _MapDict from .data_format import _DataFormat from .pandas_data_accessor import _PandasDataAccessor class _ArrayDictDataAccessor(_PandasDataAccessor): __types = (dict, list, tuple, _MapDict) @staticmethod def...
from .data_accessor import _DataAccessor from .decimator import LTTB, RDP, MinMaxDecimator, ScatterDecimator from .utils import Decimator
import inspect import typing as t from abc import ABC, abstractmethod from .._warnings import _warn from ..utils import _TaipyData from .data_format import _DataFormat class _DataAccessor(ABC): _WS_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ" @staticmethod @abstractmethod def get_supported_cl...
from __future__ import annotations import typing as t from abc import ABC, abstractmethod import numpy as np from .._warnings import _warn if t.TYPE_CHECKING: import pandas as pd class Decimator(ABC): """Base class for decimating chart data. *Decimating* is the term used to name the p...
from enum import Enum class _DataFormat(Enum): JSON = "JSON" APACHE_ARROW = "ARROW"
import base64 import pathlib import tempfile import typing as t import urllib.parse from importlib import util from pathlib import Path from sys import getsizeof from .._warnings import _warn from ..utils import _get_non_existent_file_path, _variable_decode _has_magic_module = False if util.find_spec("...
from __future__ import annotations import typing as t from types import SimpleNamespace from .._warnings import _warn class _DataScopes: _GLOBAL_ID = "global" def __init__(self) -> None: self.__scopes: t.Dict[str, SimpleNamespace] = {_DataScopes._GLOBAL_ID: SimpleNamespace()} s...
import typing as t from datetime import datetime from importlib import util import numpy as np import pandas as pd from .._warnings import _warn from ..gui import Gui from ..types import PropertyType from ..utils import _RE_PD_TYPE, _get_date_col_str_name from .data_accessor import _DataAccessor from .dat...
import typing as t import numpy as np from ..utils import Decimator class ScatterDecimator(Decimator): """A decimator designed for scatter charts. This algorithm fits the data points into a grid. If multiple points are in the same grid cell, depending on the chart configuration, some points ...
from .lttb import LTTB from .minmax import MinMaxDecimator from .rdp import RDP from .scatter_decimator import ScatterDecimator
import typing as t import numpy as np from ..utils import Decimator class MinMaxDecimator(Decimator): """A decimator using the MinMax algorithm. The MinMax algorithm is an efficient algorithm that preserves the peaks within the data. It can work very well with noisy signal data where data pe...
import typing as t import numpy as np from ..utils import Decimator class LTTB(Decimator): """A decimator using the LTTB algorithm. The LTTB algorithm is an high performance algorithm that significantly reduces the number of data points. It can work very well with time-series data to show tr...
import typing as t import numpy as np from ..utils import Decimator class RDP(Decimator): """A decimator using the RDP algorithm. The RDP algorithm reduces a shape made of line segments into a similar shape with less points. This algorithm should be used if the final visual representation is...
import typing as t from ..utils.singleton import _Singleton if t.TYPE_CHECKING: from ._element import _Block class _BuilderContextManager(object, metaclass=_Singleton): def __init__(self): self.__blocks: t.List["_Block"] = [] def push(self, element: "_Block") -> None: self....
from ._api_generator import _ElementApiGenerator from ._element import html # separate import for "Page" class so stubgen can properly generate pyi file from .page import Page _ElementApiGenerator().add_default()
import typing as t from .._renderers import _Renderer from ._context_manager import _BuilderContextManager from ._element import _Block, _DefaultBlock, _Element class Page(_Renderer): """Page generator for the Builder API. This class is used to create a page created with the Builder API.<br/> ...
import typing as t from .._renderers.factory import _Factory class _BuilderFactory(_Factory): @staticmethod def create_element(gui, element_type: str, properties: t.Dict[str, t.Any]) -> t.Tuple[str, str]: builder_html = _Factory.call_builder(gui, element_type, properties, True) if bu...
from __future__ import annotations import copy import typing as t from abc import ABC, abstractmethod from collections.abc import Iterable from ._context_manager import _BuilderContextManager from ._factory import _BuilderFactory if t.TYPE_CHECKING: from ..gui import Gui class _Element(ABC): ...
import inspect import json import os import sys import types import typing as t from taipy.logger._taipy_logger import _TaipyLogger from ..utils.singleton import _Singleton from ._element import _Block, _Control if t.TYPE_CHECKING: from ..extension.library import ElementLibrary class _ElementAp...
import typing as t from abc import ABC, abstractmethod from os import path from ..page import Page from ..utils import _is_in_notebook, _varname_from_content from ._html import _TaipyHTMLParser if t.TYPE_CHECKING: from ..builder._element import _Element from ..gui import Gui class _Renderer(Pag...
import re import typing as t from datetime import datetime from ..types import PropertyType from .builder import _Builder if t.TYPE_CHECKING: from ..extension.library import ElementLibrary from ..gui import Gui class _Factory: DEFAULT_CONTROL = "text" _START_SUFFIX = ".start" _E...
import contextlib import json import numbers import time as _time import typing as t import xml.etree.ElementTree as etree from datetime import date, datetime, time from inspect import isclass from urllib.parse import quote from .._warnings import _warn from ..partial import Partial from ..types import Pro...
import typing as t from .._warnings import _warn from ..types import NumberTypes from ..utils import _RE_PD_TYPE, _get_date_col_str_name, _MapDict def _add_to_dict_and_get(dico: t.Dict[str, t.Any], key: str, value: t.Any) -> t.Any: if key not in dico.keys(): dico[key] = value return dico[ke...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software distributed u...
from markdown.treeprocessors import Treeprocessor from ..builder import _Builder class _Postprocessor(Treeprocessor): @staticmethod def extend(md, gui, priority): instance = _Postprocessor(md) md.treeprocessors.register(instance, "taipy", priority) instance._gui = gui ...
from markdown.inlinepatterns import InlineProcessor from .factory import _MarkdownFactory class _ControlPattern(InlineProcessor): __PATTERN = _MarkdownFactory._TAIPY_START + r"([a-zA-Z][\.a-zA-Z_$0-9]*)(.*?)" + _MarkdownFactory._TAIPY_END @staticmethod def extend(md, gui, priority): in...
import re from markdown.blockprocessors import BlockProcessor from .factory import _MarkdownFactory class _StartBlockProcessor(BlockProcessor): __RE_FENCE_START = re.compile( _MarkdownFactory._TAIPY_START + r"([a-zA-Z][\.a-zA-Z_$0-9]*)\.start(.*?)" + _MarkdownFactory._TAIPY_END ) # start ...
from typing import Any from markdown.extensions import Extension from .blocproc import _StartBlockProcessor from .control import _ControlPattern from .postproc import _Postprocessor from .preproc import _Preprocessor class _TaipyMarkdownExtension(Extension): config = {"gui": ["", "Gui object for exte...
import typing as t from ..factory import _Factory class _MarkdownFactory(_Factory): # Taipy Markdown tags _TAIPY_START = "TaIpY:" _TAIPY_END = ":tAiPy" _TAIPY_BLOCK_TAGS = ["layout", "part", "expandable", "dialog", "pane"] @staticmethod def create_element(gui, control_type: str...
import re import typing as t from typing import Any, List, Tuple from markdown.preprocessors import Preprocessor as MdPreprocessor from ..._warnings import _warn from ..builder import _Builder from .factory import _MarkdownFactory if t.TYPE_CHECKING: from ...gui import Gui class _Preprocessor(MdP...
from .parser import _TaipyHTMLParser
import typing as t from ..factory import _Factory class _HtmlFactory(_Factory): @staticmethod def create_element(gui, namespace: str, control_type: str, all_properties: t.Dict[str, str]) -> t.Tuple[str, str]: builder_html = _Factory.call_builder(gui, f"{namespace}.{control_type}", all_propert...
import re import typing as t from html.parser import HTMLParser from ..._warnings import _warn from .factory import _HtmlFactory class _TaipyHTMLParser(HTMLParser): __TAIPY_NAMESPACE_RE = re.compile(r"([a-zA-Z\_]+):([a-zA-Z\_]*)") def __init__(self, gui): super().__init__() self...
import pandas as pd from taipy import Gui # ---- READ EXCEL ---- df = pd.read_excel( io="data/supermarkt_sales.xlsx", engine="openpyxl", sheet_name="Sales", skiprows=3, usecols="B:R", nrows=1000, ) # Add 'hour' column to dataframe df["hour"] = pd.to_datetime(df["Time"], format="%H:...
from taipy.gui import Markdown import numpy as np import json from data.data import data type_selector = ['Absolute', 'Relative'] selected_type = type_selector[0] def initialize_world(data): data_world = data.groupby(["Country/Region", 'Date'])\ ...
from taipy.gui import Markdown, notify import datetime as dt selected_data_node = None selected_scenario = None selected_date = None default_result = {"Date": [dt.datetime(2020,10,1)], "Deaths": [0], "ARIMA": [0], "Linear Regression": [0]} def on_submission_change(state, submitable, details): if deta...
from taipy.gui import Gui from math import cos, exp value = 10 page = """ Markdown # Taipy *Demo* Value: <|{value}|text|> <|{value}|slider|on_change=on_slider|> <|{data}|chart|> """ def compute_data(decay:int)->list: return [cos(i/6) * exp(-i*decay/600) for i in range(100)] def on_slider(s...
from taipy.gui import Gui import taipy as tp from pages.country.country import country_md from pages.world.world import world_md from pages.map.map import map_md from pages.predictions.predictions import predictions_md, selected_scenario from pages.root import root, selected_country, selector_country from co...
import yfinance as yf from taipy.gui import Gui from taipy.gui.data.decimator import MinMaxDecimator, RDP, LTTB df_AAPL = yf.Ticker("AAPL").history(interval="1d", period="100Y") df_AAPL["DATE"] = df_AAPL.index.astype("int64").astype(float) n_out = 500 decimator_instance = MinMaxDecimator(n_out=n_out) dec...
# Main Application import os import re from taipy.gui import Gui, notify, navigate import pandas as pd from datetime import datetime import chardet from utils import ( contains_related_word, categorize_columns_by_datatype, generate_prompts, all_chart_types, ) from similar_columns im...
# Create an app to upload a csv and display it in a table from taipy.gui import Gui import pandas as pd data = [] data_path = "" def data_upload(state): state.data = pd.read_csv(state.data_path) page = """ <|{data_path}|file_selector|on_action=data_upload|> <|{data}|table|> """ Gui(page).run(...
import socket import pickle import math from threading import Thread from taipy.gui import Gui, State, invoke_callback, get_state_id import numpy as np import pandas as pd init_lat = 49.247 init_long = 1.377 factory_lat = 49.246 factory_long = 1.369 diff_lat = abs(init_lat - factory_lat) * 15 diff_lon...
""" A page of the application. Page content is imported from the Drift.md file. Please refer to https://docs.taipy.io/en/latest/manuals/gui/pages for more details. """ import taipy as tp from taipy.gui import Markdown import pandas as pd from taipy.gui import notify from configuration.config import scena...
from taipy.gui import Gui import numpy as np item1 = "None" lov = [1, 2, 3] page = """ <|{item1}|selector|lov={lov}|> """ Gui(page).run()
from taipy.gui import Gui from math import cos, exp state = {"amp": 1, "data":[]} def update(state): x = [i/10 for i in range(100)] y = [math.sin(i)*state.amp for i in x] state.data = [{"data": y}] page = """ Amplitude: <|{amp}|slider|> <|Data|chart|data={data}|> """ Gui(page).run(state=stat...
import numpy as np from taipy.gui import Markdown from data.data import data marker_map = {"color":"Deaths", "size": "Size", "showscale":True, "colorscale":"Viridis"} layout_map = { "dragmode": "zoom", "mapbox": { "style": "open-street-map", "center": { "lat": 38, "lon": -90 }, "zoom...
import requests import json # GitHub API setup token = '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' headers = {'Authorization': f'token {token}'} # Function to recursively list files in a repository def list_files_in_repo(repo_full_name, path=''): url = f'https://api.github.com/repos/{repo_full_name}/conte...
from taipy.gui import Gui from math import sin, cos, pi state = { "frequency": 1, "decay": 0.01, "data": [] } page = """ # Sine and Cosine Functions Frequency: <|{frequency}|slider|min=0|max=10|step=0.1|on_change=update|> Decay: <|{decay}|slider|min=0|max=1|step=0.01|on_change=update|> <|Dat...
import numpy as np import pandas as pd from taipy.gui import Markdown from data.data import data selected_country = 'France' data_country_date = None representation_selector = ['Cumulative', 'Density'] selected_representation = representation_selector[0] layout = {'barmode':'stack', "hovermode":"x"} ...
import requests import json import logging # Setup logging logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') # GitHub API setup token = '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' headers = {'Authorization': f'token {token}'} # Function to search repositories def ...
""" Taipy app to generate mandelbrot fractals """ from taipy import Gui import numpy as np from PIL import Image import matplotlib.pyplot as plt WINDOW_SIZE = 500 cm = plt.cm.get_cmap("viridis") def generate_mandelbrot( center: int = WINDOW_SIZE / 2, dx_range: int = 1000, dx_start: f...
from taipy.gui import Markdown import numpy as np from data.data import data selector_country = list(np.sort(data['Country/Region'].astype(str).unique())) selected_country = 'France' root = Markdown("pages/root.md")
from taipy.gui import Gui from math import cos, exp value = 10 page = """ Markdown # Taipy *Demo* Value: <|{value}|text|> <|{value}|slider|> <|{compute_data(value)}|chart|> """ def compute_data(decay: int) -> list: return [cos(i / 6) * exp(-i * decay / 600) for i in range(100)] Gui(page)...
# Import from standard library import logging import random import re # Import from 3rd party libraries from taipy.gui import Gui, notify, state import taipy # Import modules import oai # Configure logger logging.basicConfig(format="\n%(asctime)s\n%(message)s", level=logging.INFO, force=True) def e...
import pymongo from dotenv import load_dotenv import os from taipy.gui import notify import pandas as pd load_dotenv() client = pymongo.MongoClient(os.getenv("MONGO_URI")) db = client["GoShop"] collection_product = db["products"] def insert_one_collection(document): return collection_product.ins...
from taipy.gui import Gui, Markdown, navigate from pages.addproduct import addproduct_md from pages.home import home_md from pages.developer import developer_md favicone = "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcStQrffFMV3jCG2wB7o7Bs1VwUJ3Z0sWQhbzA&usqp=CAU" # root_md = "<|menu|label=Menu|lov={[('...
from taipy.gui import Markdown, notify from database import all_prodcuts import pandas products = all_prodcuts() del products["_id"] products["isavailable"].replace({True: "Yes", False: "No"}) yes = 0 no = 0 for i in products["isavailable"]: if i == True: yes = yes+1 else: no...
from taipy.gui import Markdown, notify, navigate from database import insert_one_collection, all_prodcuts image1 = "https://www.identixweb.com/wp-content/uploads/2022/01/Add-Customization-for-Custom-Products.png" image2 = "https://img.freepik.com/free-vector/online-wishes-list-concept-illustration_114360-3900.jp...
from taipy.gui import Markdown img1 = "https://www.identixweb.com/wp-content/uploads/2022/01/Add-Customization-for-Custom-Products.png" developer_md = Markdown(""" <|toggle|theme|> ## Our Team **Mahi**{: .color-primary} <|container <|layout|columns= 1 1 1 |gap=30px| <| <|{img1}|image|width=100%|> Suruchi ...
# κΈ°λ³Έ νŒ¨ν‚€μ§€ import pandas as pd # 타이피 ν•¨μˆ˜ import taipy as tp from taipy.gui import Gui, Icon # ꡬ성 κ°€μ Έμ˜€κΈ° from config.config import scenario_cfg from taipy.core.config.config import Config import os # μž„μ‹œ νŒŒμΌμ„ μƒμ„±ν•˜κΈ° μœ„ν•΄ import import pathlib # 이 κ²½λ‘œλŠ” Datasouces νŽ˜μ΄μ§€μ—μ„œ ν…Œμ΄λΈ”μ„ λ‹€μš΄λ‘œλ“œν•  수 μžˆλŠ” μž„μ‹œ νŒŒμΌμ„ λ§Œλ“œλŠ” 데 μ‚¬μš©λ©λ‹ˆλ‹€. # te...
from algos.algos import * from taipy import Scope, Frequency, Config ############################################################################################################################## # λ°μ΄ν„°λ…Έλ“œ 생성 #############################################################################################################...
from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import train_test_split from sklearn.metrics import roc_auc_score import datetime as dt import pandas as pd import numpy as np ###############################################...
from pages.dialogs.dialog_roc_md import * from pages.compare_models_md import * from pages.data_visualization_md import * from pages.databases_md import * from pages.model_manager_md import * dialog_md = """ <|dialog|open={dr_show_roc}|title=ROC Curve|partial={dialog_partial_roc}|on_action=delete_dialog_roc|l...
# ν˜Όλ™ ν–‰λ ¬ λŒ€ν™” μƒμž db_confusion_matrix_md = """ <|part|render={db_table_selected=='Confusion Matrix'}| <center> <|{score_table}|table|height=200px|width=400px|show_all=True|> </center> |> """ # ν•™μŠ΅ 데이터 μ„ΈνŠΈμ— λŒ€ν•œ ν…Œμ΄λΈ” db_train_dataset_md = """ <|part|render={db_table_selected=='Training Dataset'}| <|{train_dataset}|t...
import pandas as pd import numpy as np dv_graph_selector = ['Histogram','Scatter'] dv_graph_selected = dv_graph_selector[0] # νžˆμŠ€ν† κ·Έλž¨ λŒ€ν™” μƒμž dv_width_histo = "100%" dv_height_histo = 600 dv_dict_overlay = {'barmode':'overlay', "margin":{"t":20}} dv_select_x_ = ['CREDITSCORE', 'AGE', 'TENURE', 'BALANCE', ...
from sklearn.metrics import f1_score import pandas as pd import numpy as np cm_height_histo = "100%" cm_dict_barmode = {"barmode": "stack","margin":{"t":30}} cm_options_md = "height={cm_height_histo}|width={cm_height_histo}|layout={cm_dict_barmode}" cm_compare_models_md = """ # λͺ¨λΈ 비ꡐ <br/> <br/> <br/>...
import pandas as pd import numpy as np mm_select_x_ = ['CREDITSCORE', 'AGE', 'TENURE', 'BALANCE', 'NUMOFPRODUCTS', 'HASCRCARD', 'ISACTIVEMEMBER', 'ESTIMATEDSALARY', 'GEOGRAPHY_FRANCE', 'GEOGRAPHY_GERMANY', 'GEOGRAPHY_SPAIN', 'GENDER_MALE'] mm_graph_selector_scenario = ['Metrics', 'Features', 'Histogram','Scatt...
# Roc λ‹€μ΄μ–Όλ‘œκ·Έ dr_show_roc = False def show_roc_fct(state): state.dr_show_roc = True def delete_dialog_roc(state): state.dr_show_roc = False dialog_roc = """ <center> <|{roc_dataset}|chart|x=False positive rate|y[1]=True positive rate|label[1]=True positive rate|height=500px|width=900px|type=scatter|...
from taipy.gui import Gui from page.page import * if __name__ == "__main__": Gui(page).run( use_reloader=True, title="Wine 🍷 production by Region and Year", dark_mode=False, )
from taipy.core.config import Config from config.config import df_wine_production page = """ # Wine production by Region and Year ## Data for all the regions: <|{df_wine_production}|table|height=400px|width=95%|> """
import pandas as pd def add_wine_colors(df_wine): """Adds 2 columns with Args: df_wine (DataFrame): Data from the csv file (input for the whole app) Returns: df_wine_with_colors: DataFrame with all the input columns plus 2 nexw ones, 'red_and_rose' and 'white', and drops 2 c...
import taipy as tp from taipy.core.config import Config # Loading of the TOML Config.load("config/taipy-config.toml") # Get the scenario configuration scenario_cfg = Config.scenarios["SCENARIO_WINE"] tp.Core().run() scenario_wine = tp.create_scenario(scenario_cfg) scenario_wine.submit() df_wine_pro...
from taipy.gui import Gui from tensorflow.keras import models from PIL import Image # to change img path to actual image import numpy as np class_names = { 0:'airplane', 1:'automobile', 2:'bird', 3:'cat', 4:'deer', 5:'dog', 6:'frog', 7:'horse', 8:'ship', 9:'truck'...