Skip to content

Instantly share code, notes, and snippets.

@espdev
espdev / use_matlab.py
Last active October 23, 2020 21:09
Using Matlab shared engine
# -*- coding: utf-8 -*-
import multiprocessing as mp
import matlab.engine as me
def start_matlab(ready_event, close_event):
print('Starting matlab...')
eng = me.start_matlab(option='-nodesktop')
@espdev
espdev / trading_day.py
Last active January 24, 2021 15:39
Trading days offset
from typing import Union
import pandas as pd
from trading_calendars import TradingCalendar, get_calendar
class TradingDay:
"""Offset for trading days
The class is useful to find previous and next trading days from given date.