Skip to content

Commit

Permalink
code sample for pandas-dev#42376
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed Aug 3, 2021
1 parent 833c5bd commit da5dfd1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bisect/42376.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# BUG: 1.3.0 column assignment via single columnnp.matrix behaviour change #42376

import numpy as np
from scipy import sparse

import pandas as pd

print(pd.__version__)


X = sparse.random(100, 100, density=0.2, format="csr")
df = pd.DataFrame({"a": np.arange(100)})
df["X_sum"] = X.sum(axis=1)
print(df)

0 comments on commit da5dfd1

Please sign in to comment.