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

Fix issue with .real/.imag with string dtypes #609

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

Illviljan
Copy link
Contributor

@Illviljan Illviljan commented Oct 29, 2023

np.array("").dtype.type[...] doesn't work to create an array.

  • Use np.asarray to create the fill value array instead.
  • Fix assert_eq so it uses np.array_equal for strings.

Closes #608

References
https://numpy.org/doc/stable/reference/arrays.scalars.html#indexing

@codecov
Copy link

codecov bot commented Oct 29, 2023

Codecov Report

Merging #609 (c0f3c7a) into master (44e434d) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #609   +/-   ##
=======================================
  Coverage   91.95%   91.95%           
=======================================
  Files          20       20           
  Lines        3330     3330           
=======================================
  Hits         3062     3062           
  Misses        268      268           

@Illviljan
Copy link
Contributor Author

Ready for review! The pre-commit errors looks unrelated.

@hameerabbasi hameerabbasi merged commit 7c0c962 into pydata:master Oct 30, 2023
12 checks passed
@hameerabbasi
Copy link
Collaborator

Thanks for the patch!

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.

TypeError when accessing .real and .imag attribute on sparse array of string type
2 participants