#!/usr/bin/env python import csv import sys import scipy import logging import numpy as np import matplotlib import sklearn import datetime import pandas as pd import argparse import sc_util as sc sc.initialize(logging.INFO) FLAGS = None parser = argparse.ArgumentParser() parser.add_argument('--input', type=str, default='test.csv', help='input file') FLAGS, unparsed = parser.parse_known_args() sc.logger.info("--input [%s] " % FLAGS.input) df_src = pd.read_csv(FLAGS.input, sep='|', error_bad_lines=False, quoting=csv.QUOTE_NONE, encoding='utf-8') sc.logger.info('=' * 80) df_mean = df_src['A3'].groupby(df_src['user'])
#!/usr/bin/env python import csv import sys import scipy import logging import numpy as np import matplotlib import sklearn import datetime import pandas as pd import tensorflow as tf import sc_util sc_util.initialize(logging.INFO) lines = '''222, 333'''.splitlines() #list print(lines) for i in lines: print(i) print("=" * 10 + " skipinitiallspaces=True") for l in csv.reader(lines, delimiter=',', quoting=csv.QUOTE_NONE, skipinitialspace=True): print(l) for i in l: print(i)