38 PKG =
'diagnostic_analysis'
40 roslib.load_manifest(PKG)
49 output_file = csv_file[:-4] +
'_sparse.csv'
51 input_reader = csv.reader(open(csv_file, newline=
''), delimiter=
',')
53 f = open(output_file,
'w')
54 output_writer = csv.writer(f)
57 for row
in input_reader:
58 if skip_count == skip:
59 output_writer.writerow(row)
62 skip_count = skip_count + 1
71 output_file = csv_file[:-4] +
'_sprs_len.csv'
73 input_reader = csv.reader(open(csv_file, newline=
''), delimiter=
',')
75 f = open(output_file,
'w')
76 output_writer = csv.writer(f)
79 orig_len = len(open(csv_file,
'r').read().split(
'\n'))
80 skip = max(int(orig_len / length), 1)
83 for row
in input_reader:
84 if skip_count >= skip:
85 output_writer.writerow(row)
88 skip_count = skip_count + 1