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

Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' for pandas output #3140

Merged
merged 7 commits into from
Mar 27, 2024

Conversation

seisman
Copy link
Member

@seisman seisman commented Mar 26, 2024

Address #3131 (comment).

Changes in this PR:

  • GMT_DATASET.to_dataframe: Add new parameters names/dtype/index_col
  • Session.virtualfile_to_dataset: AAdd new parameter dtype/index_col and rename column_names to names
  • Simplify some wrappers

The parameter names names/dtype/index_col are very close to the ones in the pd.read_csv function.

@@ -1747,6 +1747,8 @@ def virtualfile_to_dataset(
vfname: str,
output_type: Literal["pandas", "numpy", "file"] = "pandas",
column_names: list[str] | None = None,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Session.virtualfile_to_dataset, do we want to rename column_names to names?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f211b7d.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda prefer column_names, we don't necessarily need to follow pd.read_csv here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean using column_names in both GMT_DATASET.to_dataframe and Session.virtualfile_to_dataset?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i.e. revert f211b7d

@seisman seisman changed the title GMT_DATASET.to_dataframe: Add the parameter 'names' for specifying the column names GMT_DATASET.to_dataframe: Add the parameter 'names'/'dtype'/'index_col' Mar 26, 2024
@seisman seisman marked this pull request as ready for review March 26, 2024 06:55
@seisman seisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels Mar 26, 2024
@seisman seisman added this to the 0.12.0 milestone Mar 26, 2024
@seisman seisman changed the title GMT_DATASET.to_dataframe: Add the parameter 'names'/'dtype'/'index_col' GMT_DATASET.to_dataframe: Add new parameters 'names'/'dtype'/'index_col' Mar 26, 2024
@seisman seisman changed the title GMT_DATASET.to_dataframe: Add new parameters 'names'/'dtype'/'index_col' Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' and rename 'column_names' to 'names' Mar 26, 2024
@seisman seisman changed the title Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' and rename 'column_names' to 'names' Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' Mar 27, 2024
@seisman seisman changed the title Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' for pandas output Mar 27, 2024
@seisman seisman merged commit f0d4d21 into main Mar 27, 2024
18 of 19 checks passed
@seisman seisman deleted the dataset/to_dataframe branch March 27, 2024 02:27
@seisman seisman removed the needs review This PR has higher priority and needs review. label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants