Answered step by step
Verified Expert Solution
Question
1 Approved Answer
could you change this code to . py code? this is jupiter notebook ipny file. import pandas as pd import numpy as np import matplotlib.pyplot
could you change this code to py code? this is jupiter notebook ipny file.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
#Import the dataset
seedspdreadcsvC:UserssaranOneDriveDesktopseedsdata.csv
seeds.head
#Setup the column names
seeds.columnsarea'perimeter','compactness', 'kernel length', 'kernel width', 'asymmetry coefficient', 'kernel groove Length','class'
print seeds
#returns the number of missing values in the dataset
seeds.isnullsum
#checking if there are any negative values in any of the variables
seedsanyany
#checking if there are duplicate records in the dataset which is redundant and hence needs to be removed
seeds.duplicatedany
# Print shape of dataset
printseedsshape
#dtypes returns a Series with the data type of each column
seeds.dtypes
#describe the dataset
seeds.describe
# Peak at first lines of dataset
printseedshead
#describe is used to view some basic statistical details like percentile, mean, std etc. of a data frame or a series
#of numeric values.
printseedsdescribe
# Print class distribution of dataset
printseedsgroupbyareasize
#Class distribution
printseedsgroupbyclasssize
#box plot
seeds.plotkind'box', subplotsTrue, layout sharexFalse,shareyFalse, figsize
pltshow
# histograms
seeds.histfigsize
pltshow
#scatter plot
scattermatrixseeds figsize
pltshow
Step 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