Skip to content

Commit

Permalink
Do not assign column names again for empty DataFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Mar 29, 2024
1 parent 71cc9b7 commit 065ec12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pygmt/datatypes/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def to_dataframe(
else:
# Create a DataFrame object by concatenating multiple columns
df = pd.concat(objs=vectors, axis="columns")
if column_names is not None: # Assign column names
df.columns = column_names
if column_names is not None: # Assign column names
df.columns = column_names
if dtype is not None: # Set dtype for the whole dataset or individual columns
df = df.astype(dtype)
if index_col is not None: # Use a specific column as index
Expand Down

0 comments on commit 065ec12

Please sign in to comment.