Question
this is my code to predict a housing price based on data but i get a lot errors, how do i resolve all these errors
9]: import seaborn as sns from sklearn.linear model import LinearRegression 20]: import numpy as np import matplotlib.pyplot
472 160 RM 21.0 1680 Pave NaN Reg Lvl AllPub 0 NaN NaN 473 160 RM 21.0 1680 Pave NaN Reg AllPub Lvl 0 NaN NaN 474 160 RL 24.0
0 NaN NaN AllPub C 1430 2891 50 RM 75.0 9060 Pave Reg Lvl NaN NaN NaN Reg 69.0 Lvl AllPub 1431 2892 30 C (all) 12366 Pave NaN
H Run Code + In [102]: import numpy as np import matplotlib.pyplot as plt matplotlib inline import pandas as pd import os pri
Run Code pandas/_libs/index.pyx in pandas. libs.index. IndexEngine.get loc () pandas/ libs/index.pyx in pandas. libs.index. I
H Run Code pandas/ libs/index.pyx in pandas._libs. index. IndexEngine . get_loc () pandas/ libs/index.pyx in pandas. libs.ind
In [113]: df_train[L_SalePrice -np.log(df_train[SalePrice ]) df train_without out liers [L_SalePrice]-np. 1log (df_tra
10 10 0.8 08 06 06- 04 04 02 02 00 00 00 00 04 06 02 10 02 08 04 06 08 10 In [115]: ax [1].boxplot ( df train_without outlier
df_train_without out liers is not defined NameError: name 6]: num lines-len(cols) fig,ax-plt.subplots(nrows-num lines,ncols
Edit View Insert Cell Kemel Widgets Help Python Trusted H Run C Code 10 10 08 08- 06 06. 04 04- 02 02 00+ 00 00 02 04 06 08 0
Edit View File Insert Cell Kermel Widgets Help Truste H Run Code In [117]: for index, col in enumerate(cols): ax[index, e].s
Run Code In [118]: ax[index,1].scatter(df_train [ col], df train[L_SalePrice ]) ax[index,1].title.set text(f(col) X Log Sa
0 0
Add a comment Improve this question Transcribed image text
Answer #1

In the line df_train_original=pd.read_csv :

use df_train_original.data in subsequent steps OR change the "cols_train" to cols_train

Subsequent errors are result of df_train which is not defined unless these errors are removed.

Add a comment
Know the answer?
Add Answer to:
this is my code to predict a housing price based on data but i get a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT