第一个值是序列 t 的 NaN,但不是 s。为什么即使该系列具有相同的索引,为什么会这样。
import numpy as np
import pandas as pd
s = pd.Series([1,2,3,4,5,6],index= [1,2,3,4,5,6])
t = pd.Series([2,4,6,8,10,12],index= [1,2,3,4,5,6])
df = pd.DataFrame(np.c_[s,t],columns = ["MUL1","MUL2"])
df["MUL2"] =t
df
Output:
MUL1 MUL2
0 1 NaN
1 2 2.0
2 3 4.0
3 4 6.0
4 5 8.0
5 6 10.0
慕工程0101907
紫衣仙女
随时随地看视频慕课网APP
相关分类