This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from typing import Union | |
# input parameters | |
asset_data = pd.read('./input_file.csv') | |
bm_wts_col = 'bm_wt' | |
por_wts_col = 'por_wt' | |
grouping_level = 'sector' | |
rets_col = 'ret_1mf' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import time | |
from botocore.exceptions import ClientError | |
import pandas as pd | |
from io import BytesIO | |
from datetime import datetime | |
import pprint | |
import logging | |
log = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import gzip | |
from io import BytesIO | |
import shutil | |
aws_session = boto3.Session(aws_access_key_id='', ### AWS ACCESS KEY HERE | |
aws_secret_access_key='') ### AWS SECRET KEY HERE | |
s3_client = aws_session.client('s3') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import re | |
aws_session = boto3.Session(aws_access_key_id='', ### AWS ACCESS KEY HERE | |
aws_secret_access_key='') ### AWS SECRET KEY HERE | |
s3_client = aws_session.client('s3') | |
def list_keys(bucket, prefix='', suffix='', full_path=True, remove_ext=False): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
import gzip | |
from io import BytesIO | |
import shutil | |
aws_session = boto3.Session(aws_access_key_id='', ### AWS ACCESS KEY HERE | |
aws_secret_access_key='') ### AWS SECRET KEY HERE | |
s3_client = aws_session.client('s3') |