本文整理汇总了Python中transaction.Transaction.read方法的典型用法代码示例。如果您正苦于以下问题:Python Transaction.read方法的具体用法?Python Transaction.read怎么用?Python Transaction.read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类transaction.Transaction
的用法示例。
在下文中一共展示了Transaction.read方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open_transaction_file
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import read [as 别名]
def open_transaction_file(path):
schemes = derive_schemes(path)
if (len(schemes) == 0):
print "Cannot derive transaction format from input arguments."
elif len(schemes) > 1:
print "Multiple transaction formats might apply to the input."
else:
scheme = schemes[0]
history = Transaction.read(scheme(CAT), path)
return history
示例2: main
# 需要导入模块: from transaction import Transaction [as 别名]
# 或者: from transaction.Transaction import read [as 别名]
def main(argv):
"""Visualize command line specified transaction data."""
if (len(argv) != 2):
print "syntax: " + argv[0].split("/")[-1] + " <csv file>"
else:
schemes = derive_schemes(argv[1])
if (len(schemes) == 0):
print "Cannot derive transaction format from input arguments."
elif len(schemes) > 1:
print "Multiple transaction formats might apply to the input."
else:
scheme = schemes[0]
history = Transaction.read(scheme(CAT), argv[1])
hierarchy = [lambda t: t.month, lambda t: t.cat]
print_summary(history, hierarchy)