pandas
Question
data = {‘a’:1 , ‘b’:2 , ‘c’:3 ,’d’:4}
import pandas as pd
series = pd.Series(data)
dummy = series.copy(deep=True)
print(dummy)
the above code is to make a copy of series what happens when argument deep is set to False?
in progress
0
Machine Learning
55 years
1 Answer
796 views
Member 0
Answer ( 1 )
when the argument is set to False it creates a shallow copy of the series which means if there is any change in the original data there will be changed in the copied data.
but when deep is kept True (default) it creates a deep copy which means it saves the exact copy of the data into another location so when there a change in the original data there is no change in the copied data.