def macc_chardis(row):
    """Assigns an integer to distinguish rows of
    charging cycles from those of discharging
    cycles. -1 for discharging and +1 for charging."""
    if row['Md'] == 'D':
        return -1
    else:
        return 1