From 7913069ca1313fb6d4e7c25289910406508d5f73 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Fri, 12 Jul 2019 15:21:34 -0500 Subject: set ignore_index=True in pd.concat() since we don't care about the index --- utils/plot-energy | 4 ++-- utils/plot-fit-results | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/plot-energy b/utils/plot-energy index 969cc4b..1e8cbcb 100755 --- a/utils/plot-energy +++ b/utils/plot-energy @@ -113,8 +113,8 @@ if __name__ == '__main__': parser.add_argument("filenames", nargs='+', help="input files") args = parser.parse_args() - ev = pd.concat([pd.read_hdf(filename, "ev") for filename in args.filenames]) - fits = pd.concat([pd.read_hdf(filename, "fits") for filename in args.filenames]) + ev = pd.concat([pd.read_hdf(filename, "ev") for filename in args.filenames],ignore_index=True) + fits = pd.concat([pd.read_hdf(filename, "fits") for filename in args.filenames],ignore_index=True) # This is a bit of a hack. It appears that many times the fit will # actually do much better by including a very low energy electron or diff --git a/utils/plot-fit-results b/utils/plot-fit-results index cb90c8d..ab08586 100755 --- a/utils/plot-fit-results +++ b/utils/plot-fit-results @@ -92,9 +92,9 @@ if __name__ == '__main__': # # Note: We have to add the filename as a column to each dataset since this # script is used to analyze MC data which all has the same run number. - ev = pd.concat([pd.read_hdf(filename, "ev").assign(filename=filename) for filename in args.filenames]) - fits = pd.concat([pd.read_hdf(filename, "fits").assign(filename=filename) for filename in args.filenames]) - mcgn = pd.concat([pd.read_hdf(filename, "mcgn").assign(filename=filename) for filename in args.filenames]) + ev = pd.concat([pd.read_hdf(filename, "ev").assign(filename=filename) for filename in args.filenames],ignore_index=True) + fits = pd.concat([pd.read_hdf(filename, "fits").assign(filename=filename) for filename in args.filenames],ignore_index=True) + mcgn = pd.concat([pd.read_hdf(filename, "mcgn").assign(filename=filename) for filename in args.filenames],ignore_index=True) # get rid of 2nd events like Michel electrons ev = ev.sort_values(['run','gtid']).groupby(['filename','evn'],as_index=False).nth(0) -- cgit 93f4b97a553998ac8fb59005c3d99b303afb6f60'>plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29