From 4236aafa0dc68caeea85c785c83524ecb2b87783 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 30 Jan 2023 22:33:53 +0100 Subject: py-machine-learning: Print CSV line numbers for invalid lines (SKLearn Random Forest Classificator). * c-analysed: fix wrong length check Signed-off-by: Toni Uhlig --- examples/py-machine-learning/sklearn-random-forest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/py-machine-learning/sklearn-random-forest.py') diff --git a/examples/py-machine-learning/sklearn-random-forest.py b/examples/py-machine-learning/sklearn-random-forest.py index 090206b4e..9103bb427 100755 --- a/examples/py-machine-learning/sklearn-random-forest.py +++ b/examples/py-machine-learning/sklearn-random-forest.py @@ -280,7 +280,7 @@ if __name__ == '__main__': X += getRelevantFeaturesCSV(line) y += [isProtoClass(args.proto_class, line['proto'])] except RuntimeError as err: - print('Error: `{}\'\non line: {}'.format(err, line)) + print('Error: `{}\'\non line {}: {}'.format(err, reader.line_num - 1, line)) sys.stderr.write('CSV data set contains {} entries.\n'.format(len(X))) -- cgit v1.2.3