text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

data = pd.read_csv('../input/house-rent-prediction-dataset/House_Rent_Dataset.csv')
data

data.isnull().sum()

data = data.drop('Posted On', axis=True)
data

data.dtypes

data['House Floor'] = 0
list0 = data['Floor'].str.split(pat=' ', n=2, expand=True).iloc[:, 0]
for i, v in enumerate(data['Floor']):
    if list0.iloc[i] == 'Ground':
        data['House Floor'][i] = 0
    elif list0.iloc[i] == 'Upper':
        data['House Floor'][i] = -1
    elif list0.iloc[i] == 'Lower':
        data['House Floor'][i] = -2
    else:
        data['House Floor'][i] = list0[i]