Reputation: 318
I have two pandas series as below:
a = pd.Series([1,2,3,4,5])
b = pd.Series(['NaN','NaN','NaN','NaN','NaN'])
and I want to copy/replace a to b. namely, b= [1,2,3,4,5].
Upvotes: 0
Views: 35
Reputation: 5314
You can simply use:
b = a.copy()
you can verify that both series a
and b
are equal with:
pd.testing.assert_series_equal(a, b)
Upvotes: 2