Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pygmt.filter1d: Fix the bug that the first line is read as headers #2780

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pygmt/src/filter1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_filter1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down