Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

301
Views
El objeto 'DataFrame' no tiene atributo 'as_matrix
import pandas as pd from sklearn.model_selection import train_test_split import pandas as pd from sklearn.model_selection import train_test_split from sklearn import ensemble from sklearn.metrics import mean_absolute_error from joblib import * df = pd.read_csv('~/Downloads/Melbourne_housing_FULL.csv') df.head(n=5) del df['Address'] del df['Method'] del df['SellerG'] del df['Date'] del df['Postcode'] del df['Lattitude'] del df['Longtitude'] del df['Regionname'] del df['Propertycount'] df.dropna(axis=0, how='any', thresh=None, subset=None, inplace=True) features_df = pd.get_dummies(df, columns=['Suburb', 'CouncilArea', 'Type']) X = features_df.as_matrix() y = df['Price'].as_matrix()

¿Alguien puede ayudarme? Estoy enfrentando un error tan pronto como pongo X = Features_df.as_matrix() y = df['Price'].as_matrix() y estoy aprendiendo Machine Learning con un libro llamado Machine Learning with python by oliver ... Cualquier ayuda es muy apreciada Gracias

over 4 years ago · Santiago Trujillo
4 answers
Answer question

0

A partir de Pandas 1.0, use .to_numpy() otras formas están obsoletas de acuerdo con los documentos

over 4 years ago · Santiago Trujillo Report

0

Dataframe dejó de usar muchos atributos como .ix

Aquí necesitas este comando:

 y = df['Price'].values
over 4 years ago · Santiago Trujillo Report

0

df.as_matrix() quedó en desuso después de la versión 0.23.0. Utilice df.values en su lugar.

Siga este enlace para obtener información adicional.

over 4 years ago · Santiago Trujillo Report

0

Reemplazar .as_matrix() con .values() también resultó en un error, pero reemplazarlo con .to_numpy() funcionó perfectamente

Convierta el DataFrame en una matriz NumPy.

Nuevo en la versión 0.24.0.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!