From 46bf01cf644b897f069def2b0aca7850c4bf6445 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 30 Oct 2023 23:29:04 +0800 Subject: [PATCH] filter1d: Fix the bug that the first line is read as headers --- pygmt/src/filter1d.py | 2 +- pygmt/tests/test_filter1d.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/filter1d.py b/pygmt/src/filter1d.py index f9555c3db86..bc07e6e1314 100644 --- a/pygmt/src/filter1d.py +++ b/pygmt/src/filter1d.py @@ -130,7 +130,7 @@ def filter1d(data, output_type="pandas", outfile=None, **kwargs): # Read temporary csv output to a pandas table if outfile == tmpfile.name: # if user did not set outfile, return pd.DataFrame - result = pd.read_csv(tmpfile.name, sep="\t", comment=">") + result = pd.read_csv(tmpfile.name, sep="\t", header=None, comment=">") elif outfile != tmpfile.name: # return None if outfile set, output in outfile result = None diff --git a/pygmt/tests/test_filter1d.py b/pygmt/tests/test_filter1d.py index c03b3e4b8a5..51c9042a5a5 100644 --- a/pygmt/tests/test_filter1d.py +++ b/pygmt/tests/test_filter1d.py @@ -25,7 +25,7 @@ def test_filter1d_no_outfile(data): Test filter1d with no set outgrid. """ result = filter1d(data=data, filter_type="g5") - assert result.shape == (670, 2) + assert result.shape == (671, 2) def test_filter1d_file_output(data):