Answered step by step
Verified Expert Solution
Question
1 Approved Answer
It looks like that jupyter read my file DataP4. However, once i start using codes, it says that name DataP4 is not defined. what is
It looks like that jupyter read my file DataP4. However, once i start using codes, it says that name DataP4 is not defined. what is the issue? tried to solve it but failed.
import pandas as pd import seaborn as sns import statsmodels.formula.api as smf import statsmodels.api as sm import matplotlib.pyplot as plt import numpy as np from statsmodels.graphics.gofplots import qqplot_2samples, qqplot import scipy.stats df= pd.read_csv('DataP4.csv') import seaborn as sns from sklearn.preprocessing import LabelEncoder \#\# Variable Selection corr_mat=DataP4.corr(method='spearman ', numeric_only="True") upper_corr_mat = corr_mat.where ( np.triu(np.ones(corr_mat.shape), k=1). astype(np.bool)) \# Convert to 1-D series d drop Null values unique_corr_pairs = upper_corr_mat.unstack().dropna() NameError Traceback (most recent call last) Cell In[48], line 5 2 from sklearn.preprocessing import LabelEncoder 4 \#\#\# Variable Selection ---> 5 corr_mat=DataP4.corr(method='spearman', numeric_only="True") 6 upper_corr_mat = corr_mat. where ( 8 \# Convert to 1D series and drop Null values NameError: name 'DataP4' is not definedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started