def get_industry_name(code): if not str(code).isdigit(): return None stock_industry_code_map = Loader.stock_industry_code() industry_codes = Loader.industry_code() df = stock_industry_code_map[stock_industry_code_map["code"] == int(code)] if len(df) == 0: return None industry_code = df["industry_code"].iloc[0] df = industry_codes[industry_codes["industry_code"] == industry_code] if len(df) == 0: return None name = df["name"].iloc[0] return name
import pandas from dash.dependencies import Input, Output import dash_core_components as dcc import dash_html_components as html import plotly from plotly import tools from plotly import figure_factory as FF import dash_utils sys.path.append("lib") import utils from loader import Loader app = dash_utils.create_app() industry_code = Loader.industry_code().sort_values("industry_code") options = [ { "label": "日経平均", "value": "index/nikkei" }, { "label": "ダウ平均", "value": "index/dow" }, { "label": "ナスダック", "value": "index/nasdaq" }, { "label": "TOPIX",