The Sectors (Sectors) Data Block is a System Data Block and is not edited. The following details are informational only.
The Sectors (Sectors) Data Block retrieves sector-related data from Assette. The Data Block accepts optional input parameters AsOfDate, UseSectorMapTable, Category, and Language, with default values set if not provided. The Sectors (Sectors) Data is not edited.
Parameters:
AsOfDate
: The date to filter the sectors.UseSectorMapTable
: Determines whether to use the sector map table.Category
: The category of sectors, defaulting to “sector”.Language
: The language for the sector names, defaulting to “en-US”.
General Info #
The following table shows the default fields of the Data Block.
Field | Value |
---|---|
Name | Sectors |
Block Category | Transform |
Block Type | Python |
Data Category | None |
Output Type | Data Table |
Dependencies #
The following table shows the default dependencies of the Data Block.
Data Block | Description |
---|---|
CalculationEnv | Used to import Python modules and libraries (e.g., “import numpy as np”) [Link] |
SectorsLocalDB | [Link] |
Columns #
None
Example Definition #
AsOfDate="1900-01-01"
UseSectorMapTable="yes"
Category="sector"
Language="en-US"
if(params.__len__()>0):
if "AsOfDate" in params :
AsOfDate = params["AsOfDate"]
if "UseSectorMapTable" in params :
UseSectorMapTable = params["UseSectorMapTable"]
if "Category" in params :
Category = params["Category"]
if "Language" in params :
Language = params["Language"]
outputlist=[]
data_df = pd.DataFrame(read("SectorsLocalDB",{"AsOfDate":AsOfDate,"UseSectorMapTable":UseSectorMapTable,"Category":Category,"Language":Language })["data"])
if data_df.shape[0]>0:
# if "BatchID" not in data_df.columns:
for i in range(0, data_df.shape[0]):
outputlist.append({"Key": data_df.loc[i,"Key"],"Value": data_df.loc[i,"Value"]})
response["data"] = outputlist
Example Request #
The following code shows an example request using the default values of the Data Block.
{}