clearriverlabs.com - Balanced Programming

Description: Learn useful programming stuff

python (3834) union (2068) add (1087) set (561) sets (372) difference (337) remove (184) intersection (42) set theory (11) symmetric difference (2)

Example domain paragraphs

This dataset example is a simplified record of item sales made by a chain of retail shops. Each record is an individual item purchased from a shop belonging to this imaginary company.

1451914602.0 T0000 Glasgow G12 26.0 1451914602.0 T0000 Glasgow A63 35.0 1451914602.0 T0000 Glasgow D95 23.0 1451914602.0 T0000 Glasgow A58 81.0 1451914602.0 T0000 Glasgow B01 30.0 1451914602.0 T0000 Glasgow E64 4.0 1451914602.0 T0000 Glasgow E67 42.0 1451914602.0 T0000 Glasgow B57 16.0 1451914602.0 T0000 Glasgow G17 13.0 1451914632.0 T0001 Glasgow E64 81.0 1451914632.0 T0001 Glasgow G56 68.0 1451914632.0 T0001 Glasgow D11 21.0 1451914632.0 T0001 Glasgow B36 35.0 1451914632.0 T0001 Glasgow C87 16.0 145191463

import time import math import random CAT_LETTERS = "ABCDEFG" def get_transaction_id(transaction_number): """ :param transaction_number: int: Global counter representing number of transactions/shopping baskets generated so far. :return: str: A new TransactionID (the next in the sequence). TransactionID is "T" plus an int padded with leading 0's to 4 characters. e.g. "T0128". Note: transaction_number is updated by the record creating loop, not this function. """ new_transaction_id = "T%04d" % transaction_num