fork download
  1. import pandas as pd
  2.  
  3. # DataFrame yaratish
  4. data = {
  5. 'Ism': ['Ali', 'Vali', 'Javlon', 'Aziz', 'Saida', 'Aziza', 'Zilola', 'Olim', 'Shahzod', 'Jasur', 'Ravshan', 'Nuriddin', 'Xurshid', 'Nodir'],
  6. 'Yosh': [23, 30, 22, 25, 28, 26, 27, 40, 42, 41, 43, 46, 48, 50],
  7. 'Shahar': ['Toshkent', 'Samarqand', 'Buxoro', 'Toshkent', 'Andijon', 'Farg‘ona', 'Namangan', 'Toshkent', 'Samarqand', 'Buxoro', 'Toshkent', 'Andijon', 'Farg‘ona', 'Namangan']
  8. }
  9.  
  10. df = pd.DataFrame(data)
  11.  
  12. # Yosh 25dan katta bo'lgan va shahar Farg‘ona bo'lganlarni filtrlash
  13. filtred_df = df[(df['Yosh'] > 25) & (df['Shahar'] == 'Farg‘ona')]
  14.  
  15. print(filtred_df)
  16.  
  17.  
Success #stdin #stdout 0.32s 60560KB
stdin
Standard input is empty
stdout
        Ism    Shahar  Yosh
5     Aziza  Farg‘ona    26
12  Xurshid  Farg‘ona    48