import pandas as pd
datos = pd.read_csv('alquiler.csv',sep = ';')
datos.head(10)
list(datos['Tipo'].drop_duplicates())
residenial = ['Habitación',
'Casa',
'Departamento',
'Casa en condominio',
'Casa comercial',
'Casa de villa']
residenial
datos.head(10)
seleccion = datos['Tipo'].isin(residenial)
seleccion
datos_residenial = datos[seleccion]
datos_residenial
list(datos_residenial['Tipo'].drop_duplicates())
datos_residenial.shape[0]
datos.shape[0]
datos_residenial.index = range(datos_residenial.shape[0])
datos_residenial
datos_residenial.to_csv('alquiler_resdenial.csv',sep = ';')
datos_residenial2 = pd.read_csv('alquiler_resdenial.csv',sep = ';')
datos_residenial2
datos_residenial.to_csv('alquiler_resdenial.csv',sep = ';',index = False)
datos_residenial2 = pd.read_csv('alquiler_resdenial.csv',sep = ';')
datos_residenial2
data = [[1,2,3],[4,5,6],[7,8,9]] data
list('321')
df = pd.DataFrame(data,list('321'),list('ZYX')) df
df.sort_index(inplace = True) df
df.sort_index(inplace = True,axis = 1) df
df.sort_values(by = 'X',inplace = True) df
df.sort_values(by = '3',axis = 1,inplace = True)
df`