AutoViz中整数变量被视为类别变量
创始人
2024-11-12 16:00:42
0

使用pandas将整数变量转换为数字变量,然后将数据框作为输入使用AutoViz。以下是具体的代码示例:

import pandas as pd
from autoviz.AutoViz_Class import AutoViz_Class

# 创建一个数据框
df = pd.DataFrame({'Age': [25, 30, 35, 40],
                   'Income': [50000, 70000, 90000, 110000],
                   'Education': ['Bachelors', 'Masters', 'PhD', 'Masters']})

# 将整数列转换为数字列
df['Age'] = df['Age'].astype(float)

# 使用AutoViz
AV = AutoViz_Class()
AV.AutoViz(filename="",sep=',', depVar='Income', dfte=df, header=0, verbose=2,droplist=['Education'])

在上面的代码示例中,将整数列“Age”转换为数字列使用了df['Age'] = df['Age'].astype(float)语句。这将解决AutoViz中整数变量被视为类别变量的问题。

相关内容

热门资讯

透视黑科技!wejoker辅助... 透视黑科技!wejoker辅助脚本,we poker辅助器下载,必赢教程(有挂秘籍);1、we po...
透视能赢!wepoker免费脚... 透视能赢!wepoker免费脚本咨询,hhpoker真的假的,辅助教程(有挂秘籍);1、构建自己的w...
透视教程!pokemmo辅助脚... 透视教程!pokemmo辅助脚本,hhpoker真的假的,软件教程(有挂教程)1、很好的工具软件,可...
透视教学!wejoker辅助机... 透视教学!wejoker辅助机器人,wepoker怎么看牌型,2025版教程(有挂教程)1)wepo...
透视系统!wepoker软件安... 透视系统!wepoker软件安装包,pokemmo脚本辅助器下载,曝光教程(有挂技巧)1)pokem...
透视总结!hhpkoer辅助挂... 透视总结!hhpkoer辅助挂是真的吗,wepoker轻量版透视方法,必赢教程(有挂秘籍)1、hhp...
透视新版!wepoker怎么拿... 透视新版!wepoker怎么拿到好牌,hhpoker万能辅助器,详细教程(有挂内幕)1、在wepok...
透视线上!xpoker辅助神器... 透视线上!xpoker辅助神器,hhpoker透视方法,黑科技教程(有挂攻略);1、超多福利:超高返...
透视苹果版!hhpoker辅助... 透视苹果版!hhpoker辅助器,wepoker辅助器是真的吗,必赢方法(有挂内幕)一、wepoke...
透视黑科技!cloudpoke... 透视黑科技!cloudpoker外挂,fishpoker透视底牌,软件教程(有挂秘笈)1、fishp...