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

Preserve Complex Data Types for to_csv #61157

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

Jaspvr
Copy link

@Jaspvr Jaspvr commented Mar 20, 2025

This Pull Request solves the issue outlined in:
#60895

Complex data types like numpy arrays can now be stored in csv format and later recovered.
A new parameter, preserve_complex, is introduces, and when it is set to true in your to_csv function call, the complex data types will be preserved and can be recovered from the csv.

The way this works is by serializing Numpy arrays into JSON format for preserve_complex=True. To get them from the csv, we can set the same parameter in read_csv, and the original Numpy array will be returned.

Please refer to tests in scripts/tests/test_csv.py to see how this is used.

Please refer to the original issue for more information on the problem definition.

@snitish
Copy link
Member

snitish commented Mar 23, 2025

@Jaspvr is there an existing issue that this PR addresses? If so, could you list it in the description? If not, please create an issue describing the bug or proposed enhancement so it can be reviewed by a team member.

@Jaspvr Jaspvr changed the title Csv func Preserve Complex Data Types for to_csv Mar 28, 2025
@Jaspvr
Copy link
Author

Jaspvr commented Mar 28, 2025

@Jaspvr is there an existing issue that this PR addresses? If so, could you list it in the description? If not, please create an issue describing the bug or proposed enhancement so it can be reviewed by a team member.

Hey, just updated the description. This is in relation to #60895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants