Pandas合并返回空数据框

Pandas合并返回空数据框,第1张

Pandas合并返回空数据

avgSpeedBinID
当前斌数据帧的类型
str
和平均是
int
。只需将其中
str
一个放入
int
,合并就可以了。

current_bin['avgSpeedBinID'] = current_bin['avgSpeedBinID'].astype(int)avg.merge(current_bin, on='avgSpeedBinID')    avgSpeedBinID   avgBinSpeed avgSpeedBinDesc  temp    id   fpd0   1    3 speed < 2.5mph  0   1.1.4.1  2.8186231   2    5 2.5mph <= speed < 7.5mph   0   1.1.4.2  1.4754542   3    107.5mph <= speed < 12.5mph  0   1.1.4.3  0.8058423   4    1512.5mph <= speed < 17.5mph 0   1.1.4.4  0.5817974   5    2017.5mph <= speed <22.5mph  0   1.1.4.5  0.4503145   6    2522.5mph <= speed < 27.5mph 0   1.1.4.6  0.3791076   7    3027.5mph <= speed < 32.5mph 0   1.1.4.7  0.3351557   8    3532.5mph <= speed < 37.5mph 0   1.1.4.8  0.305992  8   9    4037.5mph <= speed < 42.5mph 0   1.1.4.9  0.2842109   10   4542.5mph <= speed < 47.5mph 0   1.1.4.10 0.26668110  11   5047.5mph <= speed < 52.5mph 0   1.1.4.11 0.25001711  12   5552.5mph <= speed < 57.5mph 0   1.1.4.12 0.23474912  13   6057.5mph <= speed < 62.5mph 0   1.1.4.13 0.22251513  14   6562.5mph <= speed < 67.5mph 0   1.1.4.14 0.21615014  15   7067.5mph <= speed < 72.5mph 0   1.1.4.15 0.21836815  16   7572.5mph <= speed0   1.1.4.16 0.22763


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5647939.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存