Skip to content
nainM edited this page Aug 26, 2018 · 25 revisions

pythonでmcmdを利用するライブラリ(β版)

install

pip install nysol

local soruce install

cd nysol

python setup.py build

python setup.py install

必要なもの

c++ compiler

boost C++ library

lib2xml Library

利用例1

import nysol.mcmd as nm

xxx1 = nm.mcal(i="jp/0.csv",c="left($s{date},6)",a="month").mcut("f=month,ret_00_00").msum({"k":"month","f":"ret_00_00"})

xxx1.run()

利用例2

import nysol.mcmd as nm

para1 = { "i":"jp/0.csv", "c":"left($s{date},6)","a":"month"}

para2 = { "f":"month,ret_00_00"}

para3 = { "k":"month","f":"ret_00_00","o":"rls000"}

xxx1 = nm.mcal(para1).mcut(para2).msum(para3)

xxx1.run()

利用例3

import nysol.mcmd as nm

xxx1 = nm.mcal(i="jp/0.csv",c="left($s{date},6)",a="month").mcut("f=month,ret_00_00").msum("k=month f=ret_00_00")

xxx2 = nm.mcal(i="jp/0.csv",c="left($s{date},6)",a="month").mcut("f=month,ret_00_00").mjoin(k="month",f="ret_00_00:mret0000",m=xxx1)

xxx2.run()

利用例5

import nysol.mcmd as nm

xxx1 = None

xxx1 <<= nm.mcal(i="jp/0.csv",c="left($s{date},6)",a="month")

xxx1 <<= nm.mcut("f=month,ret_00_00")

xxx1 <<= nm.msum("k=month f=ret_00_00")

xxx2 = None

xxx2 <<= nm.mcal(i="jp/0.csv",c="left($s{date},6)",a="month")

xxx2 <<= nm.mcut("f=month,ret_00_00")

xxx2 <<= nm.mjoin(k="month",f="ret_00_00:mret0000",m=xxx1)

xxx2.run()

利用例5

import nysol.mcmd as nm

xxx1 = nm.mcal(i="jp/0.csv",c="left($s{date},6)",a="month")

xxx2 = xxx1.msum({"k":"month","f":"ret_00_00"})

for x in xxx2:

  if x[-1] == "201608":

    print(x)