Skip to content

Commit

Permalink
style: apply black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
alimghmi committed Oct 23, 2023
1 parent 36909f7 commit cacbebd
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions transformer/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Agent:
"Doc Clause": "doc_clause",
"Fixed Rate": "fixed_rate",
"Maturity Date": "maturity_date",
"EOD Price": "price"
"EOD Price": "price",
}

def __init__(self, df: pd.DataFrame) -> None:
Expand Down Expand Up @@ -66,12 +66,21 @@ def rename_columns(self):
except Exception as e:
logger.error(f"Failed to rename columns. Error: {e}")
raise

def brakedown_instrument_name(self):
try:
df_split = self.dataframe['Instrument Name'].str.split('.', n=5, expand=True)
df_split = self.dataframe["Instrument Name"].str.split(
".", n=5, expand=True
)
print(df_split)
df_split.columns = ['Ticker', 'Tier', 'Currency', 'Doc Clause', 'Fixed Rate', 'Maturity Date']
df_split.columns = [
"Ticker",
"Tier",
"Currency",
"Doc Clause",
"Fixed Rate",
"Maturity Date",
]
self.dataframe = pd.concat([self.dataframe, df_split], axis=1)
except Exception as e:
logger.error(f"Failed to brake down instrument name. Error: {e}")
Expand Down

0 comments on commit cacbebd

Please sign in to comment.