0
我剛剛開始使用熊貓。我正在嘗試通過使用sockets.gethostbtname()解析主機名來填充IP地址列。使用Pandas和socket.gethostbyname填充數據幀的缺失IP地址
下面也稱爲數據
domain ip_address
0 google.com NaN
1 yahoo.com NaN
樣本數據幀我有以下代碼:
data.ip_address = data['ip_address'].fillna(socket.gethostbyname(data.iloc[data.index]['domain']))
,但我得到的錯誤如下:
TypeError: gethostbyname() argument 1 must be str, bytes or bytearray, not Series