Assignment 1
Assignment 1
In [1]:
import pandas as pd
In [2]:
df=pd.read_csv("/home/ubuntu/Downloads/iris.csv")
In [3]:
df.head()
Out[3]:
In [4]:
df.tail()
Out[4]:
In [6]:
df.index
Out[6]:
In [7]:
df.columns
Out[7]:
In [8]:
df.shape
Out[8]:
(150, 5)
In [9]:
df.dtypes
Out[9]:
sepal_length float64
sepal_width float64
petal_length float64
petal_width float64
species object
dtype: object
In [10]:
df.columns.values
Out[10]:
In [11]:
df.describe()
Out[11]:
In [12]:
df.describe(include="all")
Out[12]:
In [13]:
df.isnull()
Out[13]:
In [14]:
df.isna()
Out[14]:
In [15]:
df.notnull()
Out[15]:
In [16]:
df.notna()
Out[16]:
In [17]:
df.isnull().sum()
Out[17]:
sepal_length 0
sepal_width 0
petal_length 0
petal_width 0
species 0
dtype: int64
In [18]:
df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 150 entries, 0 to 149
Data columns (total 5 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 sepal_length 150 non-null float64
1 sepal_width 150 non-null float64
2 petal_length 150 non-null float64
3 petal_width 150 non-null float64
4 species 150 non-null object
dtypes: float64(4), object(1)
memory usage: 6.0+ KB
In [19]:
df.isnull().any()
Out[19]:
sepal_length False
sepal_width False
petal_length False
petal_width False
species False
dtype: bool
In [20]:
df.iloc[3]
Out[20]:
sepal_length 4.6
sepal_width 3.1
petal_length 1.5
petal_width 0.2
species setosa
Name: 3, dtype: object
In [21]:
df[0:3]
Out[21]:
In [ ]: