id
stringlengths
16
145
text
stringlengths
1
179k
title
stringclasses
1 value
scipy_io/7510_3_0.txt
[ ](https://github.com/)
scipy_io/844_30_0.txt
Cancel Submit feedback
scipy_io/844_127_0.txt
Sorry, something went wrong.
scipy_io/7510_97_0.txt
* 👍 2 reactions
scipy_io/7510_6_0.txt
* [ Actions Automate any workflow ](https://github.com/features/actions) * [ Packages Host and manage packages ](https://github.com/features/packages) * [ Security Find and fix vulnerabilities ](https://github.com/features/security) * [ Codespaces Instant dev environments ](https://github.com/features/codespace...
scipy_io/7510_130_0.txt
This makes a lot of sense to me. In fact, for our project, we've tried to avoid using ` matrix ` at all. Primarily because we sometimes have to do elementwise multiplication. The separate operators for dot product and elementwise multiplication is helpful. However, ` scipy.sparse ` seems pretty committed to the matrix ...
scipy_io/844_96_0.txt
> xstr <- "/testdata/X.npz" > Xscp <- scipy$sparse$load_npz(xstr) Error in validObject(.Object) : invalid class "dgCMatrix" object: invalid object for slot "Dim" in class "dgCMatrix": got class "numeric", should be or extend class "integer ```"
scipy_io/7510_21_0.txt
* [ Pricing ](https://github.com/pricing)
scipy_io/scipy_io_4_0.txt
[ SciPy v1.12.0 Manual ](../../index.html) * [ Installing ](https://scipy.org/install/) * [ User Guide ](../../tutorial/index.html) * [ API reference ](../index.html) * [ Building from source ](../../building/index.html) * [ Development ](../../dev/index.html) * [ Release notes ](../../release.html) __ _...
scipy_io/7510_31_0.txt
# Saved searches
scipy_io/844_133_0.txt
Projects
scipy_io/844_89_0.txt
Author
scipy_io/7510_69_0.txt
It is confusing because different operations return either numpy arrays or numpy matrices, and since [ we are working with ](https://github.com/greenelab/hetmech) arrays that are often inter-converted between sparse and dense, it would be very helpful to have consistency in output array type (ie. operations between spa...
scipy_io/7510_147_0.txt
* 👍 1 reaction
scipy_io/scipysparsesavenpzht_39_0.txt
next
scipy_io/scipysparsesavenpzht_3_0.txt
[ ![SciPy v1.13.0 Manual - Home](../../_static/logo.svg) ](../../index.html)
scipy_io/scipysparsesavenpzht_34_0.txt
Go Back Open In Tab
scipy_io/844_18_0.txt
* [ The ReadME Project GitHub community articles ](https://github.com/readme)
scipy_io/844_143_0.txt
### Footer navigation
scipy_io/844_65_0.txt
xstr <- "/keep/by_id/su92l-4zz18-jq2eftdx22eow6s/X.npz" Xscp <- scipy$sparse$load_npz(xstr) Xscp <- scipy$sparse$load_npz(xstr)
scipy_io/844_131_0.txt
Labels
scipy_io/sparsesavenpzhtml_7_0.txt
# save_npz 
scipy_io/7510_186_0.txt
Development
scipy_io/sparsesavenpzhtml_27_0.txt
On Read the Docs
scipy_io/7510_193_0.txt
* [ Terms ](https://docs.github.com/site-policy/github-terms/github-terms-of-service) * [ Privacy ](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement) * [ Security ](https://github.com/security) * [ Status ](https://www.githubstatus.com/) * [ Docs ](https://docs.github.com/) * [ Contact ](ht...
scipy_io/7510_98_0.txt
Sorry, something went wrong.
scipy_io/844_49_0.txt
By clicking “Sign up for GitHub”, you agree to our [ terms of service ](https://docs.github.com/terms) and [ privacy statement ](https://docs.github.com/privacy) . We’ll occasionally send you account related emails.
scipy_io/7510_48_0.txt
[ Sign up for GitHub ](/signup?return_to=%2Fscipy%2Fscipy%2Fissues%2Fnew%2Fchoose)
scipy_io/844_1_0.txt
## Navigation Menu
scipy_io/scipysparsesavenpzht_19_0.txt
**compressed** bool, optional
scipy_io/7510_157_0.txt
All reactions
scipy_io/7510_137_0.txt
Member
scipy_io/scipysparsesavenpzht_6_0.txt
* [ Installing ](https://scipy.org/install/) * [ User Guide ](../../tutorial/index.html) * [ API reference ](../index.html) * [ Building from source ](../../building/index.html) * [ Development ](../../dev/index.html) * [ Release notes ](../../release.html)
scipy_io/7510_108_0.txt
👍 1 zietzm reacted with thumbs up emoji
scipy_io/scipysparsesavenpzht_5_0.txt
* [ __ GitHub ](https://github.com/scipy/scipy "GitHub") * [ __ Twitter ](https://twitter.com/SciPy_team "Twitter")
scipy_io/7510_123_0.txt
array = numpy.array(data) matrix = numpy.matrix(data) sparse = csc_matrix(data)
scipy_io/7510_72_0.txt
import numpy as np from scipy.sparse import csc_matrix
scipy_io/7510_90_0.txt
* ` numpy.array + scipy.sparse ` returns a ` numpy.array ` * ` numpy.matrix + scipy.sparse ` returns a ` numpy.matrix `
scipy_io/844_59_0.txt
[ ![@swzCuroverse](https://avatars.githubusercontent.com/u/15944983?s=80&u=02b888e09a02a8239a3789bee4f62df3a1074388&v=4) ](/swzCuroverse)
scipy_io/844_108_0.txt
Sorry, something went wrong.
scipy_io/7510_155_0.txt
> array -= sparse converting to matrix is certainly a bug
scipy_io/7510_85_0.txt
Copy link
scipy_io/844_69_0.txt
locale: [1] C
scipy_io/7510_34_0.txt
Query
scipy_io/7510_78_0.txt
sp_mat == mat >>> matrix([[ True, True], [ True, True]], dtype=bool)
scipy_io/844_58_0.txt
## Comments
scipy_io/scipysparsesavenpzht_17_0.txt
**matrix: spmatrix or sparray**
scipy_io/scipysparsesavenpzht_18_0.txt
The sparse matrix or array to save. Supported formats: ` csc ` , ` csr ` , ` bsr ` , ` dia ` or ` coo ` .
scipy_io/scipysparsesavenpzht_35_0.txt
[ __
scipy_io/scipysparsesavenpzht_33_0.txt
>>> sparse_matrix <2x3 sparse matrix of type '<class 'numpy.int64'>' with 2 stored elements in Compressed Sparse Column format> >>> sparse_matrix.toarray() array([[0, 0, 3], [4, 0, 0]], dtype=int64)
scipy_io/844_50_0.txt
Already on GitHub? [ Sign in ](/login?return_to=%2Frstudio%2Freticulate%2Fissues%2Fnew%2Fchoose) to your account
scipy_io/scipysparsesavenpzht_42_0.txt
__ On this page
scipy_io/scipysparsesavenpzht_36_0.txt
previous
scipy_io/7510_9_0.txt
* Solutions
scipy_io/7510_102_0.txt
###
scipy_io/844_142_0.txt
[ ](https://github.com "GitHub") © 2024 GitHub, Inc.
scipy_io/7510_174_0.txt
---
scipy_io/scipy_io_10_0.txt
[ SciPy v1.12.0 Manual ](../../index.html) * [ Installing ](https://scipy.org/install/) * [ User Guide ](../../tutorial/index.html) * [ API reference ](../index.html) * [ Building from source ](../../building/index.html) * [ Development ](../../dev/index.html) * [ Release notes ](../../release.html) __ _...
scipy_io/sparsesavenpzhtml_8_0.txt
sparse. save_npz ( _ filename _ , _ matrix _ , _ compressed = True _ ) [ [source] ](../_modules/sparse/_io.html#save_npz) 
scipy_io/844_119_0.txt
Copy link
scipy_io/844_140_0.txt
[ ![@kevinushey](https://avatars.githubusercontent.com/u/1976582?s=52&v=4) ](/kevinushey) [ ![@swzCuroverse](https://avatars.githubusercontent.com/u/15944983?s=52&v=4) ](/swzCuroverse)
scipy_io/scipy_io_5_0.txt
[ SciPy v1.12.0 Manual ](../../index.html) * [ Installing ](https://scipy.org/install/) * [ User Guide ](../../tutorial/index.html) * [ API reference ](../index.html) * [ Building from source ](../../building/index.html) * [ Development ](../../dev/index.html) * [ Release notes ](../../release.html) __ _...
scipy_io/7510_170_0.txt
Copy link
scipy_io/7510_162_0.txt
###
scipy_io/7510_17_0.txt
* [ GitHub Sponsors Fund open source developers ](https://github.com/sponsors)
scipy_io/sparsesavenpzhtml_28_0.txt
[ Project Home ](//readthedocs.org/projects/sparse-nd/?fromdocs=sparse-nd) [ Builds ](//readthedocs.org/builds/sparse-nd/?fromdocs=sparse-nd)
scipy_io/scipy_io_6_0.txt
[ SciPy v1.12.0 Manual ](../../index.html) * [ Installing ](https://scipy.org/install/) * [ User Guide ](../../tutorial/index.html) * [ API reference ](../index.html) * [ Building from source ](../../building/index.html) * [ Development ](../../dev/index.html) * [ Release notes ](../../release.html) __ _...
scipy_io/7510_135_0.txt
[ ![@perimosocordiae](https://avatars.githubusercontent.com/u/82855?s=80&v=4) ](/perimosocordiae)
scipy_io/7510_84_0.txt
[ ![@dhimmel](https://avatars.githubusercontent.com/u/1117703?s=80&u=d0385705e084bf1e92d117c03a50aeb25cba9725&v=4) ](/dhimmel)
scipy_io/scipy_io_2_0.txt
[ SciPy v1.12.0 Manual ](../../index.html) * [ Installing ](https://scipy.org/install/) * [ User Guide ](../../tutorial/index.html) * [ API reference ](../index.html) * [ Building from source ](../../building/index.html) * [ Development ](../../dev/index.html) * [ Release notes ](../../release.html) __ _...
scipy_io/7510_71_0.txt
### Reproducing code example:
scipy_io/scipysparsesavenpzht_29_0.txt
Try it in your browser!
scipy_io/7510_41_0.txt
[ scipy ](/scipy) / **[ scipy ](/scipy/scipy) ** Public
scipy_io/7510_141_0.txt
We determine if the output is sparse without considering the contents of the operands, based on the worst-case behavior. Thus, ` sparse - dense ` is always dense, even if the particular dense operand happens to be mostly zeros. In the case of dot products, the worst-case is that the dense operand has no zeros and the s...
scipy_io/7510_49_0.txt
By clicking “Sign up for GitHub”, you agree to our [ terms of service ](https://docs.github.com/terms) and [ privacy statement ](https://docs.github.com/privacy) . We’ll occasionally send you account related emails.
scipy_io/7510_120_0.txt
[ @perimosocordiae ](https://github.com/perimosocordiae) so it sounds like goal is to imitate the type behavior of ` numpy.matrix ` . Let's work with the following definitions:
scipy_io/7510_70_0.txt
It makes sense that operations between like types return the same type as the input type. However, it would be nice if operations between numpy.arrays and scipy.sparse matrices would return always the same array type.
scipy_io/844_134_0.txt
None yet
scipy_io/7510_5_0.txt
* Product
scipy_io/7510_57_0.txt
[ zietzm ](/zietzm) opened this issue Jun 20, 2017 · 7 comments
scipy_io/7510_15_0.txt
* [ Learning Pathways ](https://resources.github.com/learn/pathways) * [ White papers, Ebooks, Webinars ](https://resources.github.com) * [ Customer Stories ](https://github.com/customer-stories) * [ Partners ](https://partner.github.com)
scipy_io/7510_39_0.txt
You signed in with another tab or window. [ Reload ]() to refresh your session. You signed out in another tab or window. [ Reload ]() to refresh your session. You switched accounts on another tab or window. [ Reload ]() to refresh your session. Dismiss alert
scipy_io/7510_144_0.txt
---
scipy_io/scipy_io_19_0.txt
[ SciPy v1.12.0 Manual ](../../index.html) * [ Installing ](https://scipy.org/install/) * [ User Guide ](../../tutorial/index.html) * [ API reference ](../index.html) * [ Building from source ](../../building/index.html) * [ Development ](../../dev/index.html) * [ Release notes ](../../release.html) __ _...
scipy_io/7510_191_0.txt
[ ](https://github.com "GitHub") © 2024 GitHub, Inc.
scipy_io/7510_1_0.txt
## Navigation Menu
scipy_io/scipysparsesavenpzht_13_0.txt
Save a sparse matrix or array to a file using ` .npz ` format.
scipy_io/844_35_0.txt
To see all available qualifiers, see our [ documentation ](https://docs.github.com/search-github/github-code-search/understanding- github-code-search-syntax) .
scipy_io/7510_110_0.txt
* 👍 1 reaction
scipy_io/7510_37_0.txt
[ Sign in ](/login?return_to=https%3A%2F%2Fgithub.com%2Fscipy%2Fscipy%2Fissues%2F7510)
scipy_io/844_139_0.txt
2 participants
scipy_io/844_64_0.txt
library(reticulate) scipy <- import("scipy") np <- import("numpy")
scipy_io/7510_54_0.txt
[ zietzm ](/zietzm) opened this issue Jun 20, 2017 · 7 comments
scipy_io/844_51_0.txt
Jump to bottom
scipy_io/scipysparsesavenpzht_15_0.txt
**file** str or file-like object
scipy_io/7510_165_0.txt
As far as I know there aren't any open PRs along those lines yet.
scipy_io/7510_20_0.txt
* [ Topics ](https://github.com/topics) * [ Trending ](https://github.com/trending) * [ Collections ](https://github.com/collections)
scipy_io/7510_125_0.txt
For the dot product case, I will use ` @ ` rather than ` * ` for clarity. ` array @ matrix ` and ` matrix @ array ` both return a matrix. Hence, ` array @ sparse ` and ` sparse @ array ` should return a matrix, but instead they return an array.
scipy_io/844_125_0.txt
---
scipy_io/844_43_0.txt
* [ Code ](/rstudio/reticulate) * [ Issues 415 ](/rstudio/reticulate/issues) * [ Pull requests 11 ](/rstudio/reticulate/pulls) * [ Actions ](/rstudio/reticulate/actions) * [ Projects 0 ](/rstudio/reticulate/projects) * [ Security ](/rstudio/reticulate/security) * [ Insights ](/rstudio/reticulate/pulse)