You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The incols parameter does not always work for pandas.DataFrame #1440
Under certain cases, the incols (-i) parameter does not work to swap the input columns. From the best that I can tell, the bug happens when there are floats in both columns.
Full code that generated the error
## Test incols (-i) option# Create some data in a dataframedata_incols=pd.DataFrame(data={'col1': [-0.5, 0, 0.5], 'col2': [-0.75, 0, 0.75]})
# Write the data to a filedata_incols.to_csv(path_or_buf="data_incols.txt", sep=" ", index=False, header=False)
# Test passing data in a virtual filefig=pygmt.Figure()
# Plot the dataframe datafig.plot(data=data_incols, frame=True, region="-1/1/-1/1", projection="X5c", incols="1,0")
fig.savefig("test_i1_virtual.png")
# Test passing data in a filefig=pygmt.Figure()
# Plot the file datafig.plot(data="data_incols.txt", frame=True, region="-1/1/-1/1", projection="X5c", incols="1,0")
fig.savefig("test_i1_file.png")
Expected outcome
Two files with the same plot
Actual outcome
Test with virtual file:
Test with ASCII file:
Full error message
No error message
System information
Please paste the output of python -c "import pygmt; pygmt.show_versions()":
I have a few bugs similar to this for various lower-case common options. Does anyone have advice for whether I should open these bug reports in the PyGMT or GMT repository? I'm confident they are upstream bugs, but at the same time I do not expect that we would be able to reproduce them without debugging through PyGMT first.
Activity
maxrjones commentedon Aug 11, 2021
I have a few bugs similar to this for various lower-case common options. Does anyone have advice for whether I should open these bug reports in the PyGMT or GMT repository? I'm confident they are upstream bugs, but at the same time I do not expect that we would be able to reproduce them without debugging through PyGMT first.
maxrjones commentedon Nov 12, 2021
Fixed by GenericMappingTools/gmt#5989, but reopening to add a regression test.