Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!