【问题标题】:How to convert a float64 variable into a string?如何将 float64 变量转换为字符串?
【发布时间】:2021-12-02 23:54:48
【问题描述】:

我尝试将我的 float64 变量转换为 str : data['Abo_str'] = data['Abo'].isnull().astype(str) 但结果是假的。 我该怎么做 ? 谢谢

【问题讨论】:

    标签: string type-conversion float64


    【解决方案1】:

    如果您在 Python 中实现,您正在使用哪种语言实现。下面的代码可能对你有用。

    float_value = 1.99
    string_value = str(float_value)
    print(string_value)
    

    【讨论】:

    • 我在 Spyder 上使用 Python。但我尝试了这段代码,但结果是“假”。我的“数据”数据框中有我的“Abo”变量,我想创建或将作为 float64 的“Abo”变量转换为字符串。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-07-04
    • 1970-01-01
    • 2010-09-30
    • 2016-11-29
    相关资源
    最近更新 更多