Skip to content

Support "dense" as a "sparse format" option to return numpy arrays. #7980

@dschult

Description

@dschult

Support 'dense' as a format of scipy sparse that returns a numpy array. The idea is to add support for returning the "dense" format for a number of functions that currently return sparse but don't have a format option. This is based on a discussion in #7973 that includes this comment:

to_scipy_sparse_array is another function that returns a scipy sparse array and has the format= argument, so it also currently supports "dense" format (but this isn't documented).

The other functions I found that return scipy sparse arrays but don't have a way to specify the format are adjacency_matrix, attr_sparse_matrix, bethe_hessian_matrix, incidence_matrix, laplacian_matrix, normalized_laplacian_matrix, and tournament_matrix. I don't recommend adding format= to these functions in this PR, but if anybody thinks doing so is a good idea then please make a new issue or PR to continue exploring this option.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions