@staticmethod
def convert_monthly(df,date_field,endswith='trade_dt'):
ds = df[date_field].unique()
if endswith=='trade_dt':
tds = pd.Series(ds, ds).resample('M').last().values
else:
tds=pd.Series(ds,ds).resample('M').last().index.tolist()
df = df[df['con_date'].isin(tds)]
return df