Answered step by step
Verified Expert Solution
Link Copied!

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
seeds=pd.read_csv('C:/Users/saran/OneDrive/Desktop/seeds_data.csv')
seeds.head()
#Setup the column names
seeds.columns=['area','perimeter','compactness', 'kernel length', 'kernel width', 'asymmetry coefficient', 'kernel groove Length','class']
print (seeds)
#returns the number of missing values in the dataset
seeds.isnull().sum()
#checking if there are any negative values in any of the variables
(seeds<0).any().any()
#checking if there are duplicate records in the dataset which is redundant and hence needs to be removed
seeds.duplicated().any()
# Print shape of dataset
print(seeds.shape)
#dtypes returns a Series with the data type of each column
seeds.dtypes
#describe the dataset
seeds.describe()
# Peak at first 20 lines of dataset
print(seeds.head(20))
#describe() is used to view some basic statistical details like percentile, mean, std, etc. of a data frame or a series
#of numeric values.
print(seeds.describe())
# Print class distribution of dataset
print(seeds.groupby('area').size())
#Class distribution
print(seeds.groupby('class').size())
#box plot
seeds.plot(kind='box', subplots=True, layout=(7,5), sharex=False,sharey=False, figsize=(20,30))
plt.show()
# histograms
seeds.hist(figsize=(10,10))
plt.show()
#scatter plot
scatter_matrix(seeds, figsize=(10,10))
plt.show()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

fscanf retums a special value EOF that stands for...

Answered: 1 week ago