简体   繁体   English

无法在 python 中将“numpy.float64”转换为 int

[英]Not able to 'numpy.float64' to int in python

I am trying to convert 'numpy.float64' to float to do this:我正在尝试将'numpy.float64'转换为float来执行此操作:

在此处输入图像描述

ax.get_ylim()[0].astype(float)

Which prints out -2.25打印出-2.25

But when I check with type(ax.get_ylim()[0].astype(float)) it is printing out numpy.float64 .但是当我检查type(ax.get_ylim()[0].astype(float))时,它会打印出numpy.float64 Why is it not changing the data type?为什么它不改变数据类型?

Can you try the following:您可以尝试以下方法:

float(ax.get_ylim()[0])

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM