fork download
  1. import pandas as pd
  2.  
  3. # DataFrame yaratish
  4. data = {
  5. 'Ism': ['Ali', 'Vali', 'Javlon', 'Aziz', 'Saida', 'Aziza', 'Zilola', 'Akmal', 'Karim', 'Sodiq', 'Mubina', 'Shoira', 'Durdona', 'Malika', 'Samira'],
  6. 'Yosh': [23, 30, 22, 25, 28, 26, 27, 34, 37, 41, 33, 18, 29, 36, 44],
  7. 'Shahar': ['Toshkent', 'Samarqand', 'Buxoro', 'Toshkent', 'Andijon', 'Farg‘ona', 'Namangan', 'Jizzax', 'Qashqadaryo', 'Navoiy', 'Xorazm', 'Surxandaryo', 'Farg‘ona', 'Andijon', 'Toshkent']
  8. }
  9.  
  10. # DataFrameni yaratish
  11. df = pd.DataFrame(data)
  12.  
  13. # Yosh 25dan katta va shahar 'Farg‘ona' bo'lganlarni filtrlash
  14. filtered_df = df[(df['Yosh'] > 25) & (df['Shahar'] == 'Farg‘ona')]
  15.  
  16. # Natijani chop etish
  17. print(filtered_df)
  18.  
Success #stdin #stdout 0.4s 60588KB
stdin
Standard input is empty
stdout
        Ism    Shahar  Yosh
5     Aziza  Farg‘ona    26
12  Durdona  Farg‘ona    29