Attributes are the features of any object. They can be accessed by following a dot and the name of the following attribute.
Methods are always associated with an object where as the Functions are not dependent on any object. In simple term a method is on a object where as a function is independent of object.
import pandas as pd
# Fetching data from url as csv by mentioning values of various paramters
data = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data",
header = None,
index_col = False,
names = ['sepal_length','sepal_width','petal_length','petal_width','iris_class'])
# Unique classes of iris datasets
data.iris_class.unique()
array([‘Iris-setosa’, ‘Iris-versicolor’, ‘Iris-virginica’], dtype=object)
data_setosa = data[data.iris_class == 'Iris-setosa']
data_versicolor = data[data.iris_class == 'Iris-versicolor']
data_virginica = data[data.iris_class == 'Iris-virginica']
'''
Now we can have a look at descriptive statistics summary for each of the subset and can make inference like following -
* Each of the subset is of same size i.e., 50
* Average Sepal and Petal Length is lowest in setosa and highest in virginica
'''
# Import the required modules
import pandas as pd
Reading the dataset using read.csv() function with mentioning column names in names parameters.
#Fetching data from url as csv by mentioning values of various paramters
data = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data",
header = None,
index_col = False,
names = ['sepal_length','sepal_width','petal_length','petal_width','iris_class'])