Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mertdurukan/1fe9cee20a42ef25ee2301fe6f0bbb89 to your computer and use it in GitHub Desktop.
Save mertdurukan/1fe9cee20a42ef25ee2301fe6f0bbb89 to your computer and use it in GitHub Desktop.
import pandas as pd 
import numpy as np
# Veri çerçevesi oluşturma
data = pd.DataFrame({
'isim': ['Ali', 'Ayşe', 'Fatma', 'Mehmet'],
'yaş': [25, np.nan, 30, np.nan]
})
# Eksik değerleri "yaş" sütununun ortalaması ile doldurma
data['yaş'].fillna(data['yaş'].mean(), inplace=True)
print(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment