DSBDA3
DSBDA3
import numpy as np
import matplotlib.pyplot as plt
In [5]: sales.head()
In [7]: sales.tail() #Show me the last 5 rows from the table named sales
Out[9]: (10, 3)
In [11]: sales.isnull().sum() #It tells you how many missing values (nulls) are in each column of your sales table.
Out[11]: Name 0
AgeGroup 0
Income 0
dtype: int64
In [13]: sales.count() #tells you how many non-missing (non-null) values are present in each column
Out[13]: Name 10
AgeGroup 10
Income 10
dtype: int64
In [14]: sales.sum()
In [17]: print(sales.columns) #This will show you the actual column names
In [3]: iris.head()
Out[3]: sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) species
In [4]: iris.tail()
Out[4]: sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) species
In [5]: iris.shape
Out[5]: (150, 5)
In [6]: print(iris.columns)
In [10]: iris.describe()
Out[10]: sepal length (cm) sepal width (cm) petal length (cm) petal width (cm)
In [14]: print(iris['species'].unique())
In [16]: # Now use the correct species names (based on the above output)
species_list = iris['species'].unique()
Out[18]: sepal length (cm) sepal width (cm) petal length (cm) petal width (cm) species
In [ ]: