第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

屬性錯(cuò)誤:“numpy.timedelta64”對象沒有屬性“total_seconds”與熊貓

屬性錯(cuò)誤:“numpy.timedelta64”對象沒有屬性“total_seconds”與熊貓

夢里花落0921 2022-08-16 10:11:59
我正在嘗試將嗅探時(shí)間轉(zhuǎn)換為秒數(shù)。我已經(jīng)在Python Pandas DataFrame中查看了將timedelta64[ns]列轉(zhuǎn)換為秒,但是該解決方案不起作用。我想也許熊貓線可能有錯(cuò)。print(sniffTime)print(type(sniffTime))輸出:821693000 nanoseconds<class 'numpy.timedelta64'>錯(cuò)誤AttributeError: 'numpy.timedelta64' object has no attribute 'total_seconds'在線:df['PerSec']=df['PerSec'].div(sniffTime.total_seconds())
查看完整描述

1 回答

?
繁星淼淼

TA貢獻(xiàn)1775條經(jīng)驗(yàn) 獲得超11個(gè)贊

您可以將 numpy 標(biāo)量轉(zhuǎn)換為 Timedelta,因此可以使用Timedelta.total_seconds

df['PerSec']=df['PerSec'].div(pd.Timedelta(sniffTime).total_seconds())


查看完整回答
反對 回復(fù) 2022-08-16
  • 1 回答
  • 0 關(guān)注
  • 191 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)