-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Closed
Labels
Closing CandidateMay be closeable, needs more eyeballsMay be closeable, needs more eyeballsDuplicate ReportDuplicate issue or pull requestDuplicate issue or pull requestNeeds TriageIssue that has not been reviewed by a pandas team memberIssue that has not been reviewed by a pandas team memberUsage Question
Description
-
I have searched the [pandas] tag on StackOverflow for similar questions.
-
I have asked my usage related question on StackOverflow.
Question about pandas
>>> import numpy as np
>>> import pandas as pd
>>> mat = np.array([[1,2], [2,3]])
>>> mat
array([[1, 2],
[2, 3]])
>>> df = pd.DataFrame(mat)
>>> df.iloc[0,1] = 4
>>> mat
array([[1, 4],
[2, 3]])
Why the value in the original mat
is also changed? I am not sure if this is a bug or Pandas' way of doing things. I found it to be very confusing.
Metadata
Metadata
Assignees
Labels
Closing CandidateMay be closeable, needs more eyeballsMay be closeable, needs more eyeballsDuplicate ReportDuplicate issue or pull requestDuplicate issue or pull requestNeeds TriageIssue that has not been reviewed by a pandas team memberIssue that has not been reviewed by a pandas team memberUsage Question