Pandalar DataFrame.describe()

Açıklama () yöntemi, aşağıdaki gibi bazı istatistiksel verileri hesaplamak için kullanılır: yüzdelik dilim, ortalama Ve std Serinin veya DataFrame'in sayısal değerleri. Hem sayısal hem de nesne serilerini ve ayrıca karışık veri türlerinin DataFrame sütun kümelerini analiz eder.

Sözdizimi

 DataFrame.describe(percentiles=None, include=None, exclude=None)  

Parametreler

    yüzdelik: 0 ile 1 arasında olması gereken sayıların veri tipi listesi niteliğinde olan isteğe bağlı bir parametredir. Varsayılan değeri [.25, .5, .75] olup 25., 50. ve 75. yüzdelik dilimleri döndürür. katmak: Ayrıca DataFrame'i tanımlarken veri türlerinin listesini içeren isteğe bağlı bir parametredir. Varsayılan değeri Hiçbiri'dir. hariç tutmak: Ayrıca DataFrame'i tanımlarken veri türleri listesini hariç tutan isteğe bağlı bir parametredir. Varsayılan değeri Hiçbiri'dir.

İadeler

Serinin ve DataFrame'in istatistiksel özetini döndürür.

Örnek 1

 import pandas as pd import numpy as np a1 = pd.Series([1, 2, 3]) a1.describe()  

Çıktı

 count 3.0 mean 2.0 std 1.0 min 1.0 25% 1.5 50% 2.0 75% 2.5 max 3.0 dtype: float64  

Örnek2

 import pandas as pd import numpy as np a1 = pd.Series(['p', 'q', 'q', 'r']) a1.describe()  

Çıktı

 count 4 unique 3 top q freq 2 dtype: object  

Örnek3

 import pandas as pd import numpy as np a1 = pd.Series([1, 2, 3]) a1.describe() a1 = pd.Series(['p', 'q', 'q', 'r']) a1.describe() info = pd.DataFrame({'categorical': pd.Categorical(['s','t','u']), 'numeric': [1, 2, 3], 'object': ['p', 'q', 'r'] }) info.describe(include=[np.number]) info.describe(include=[np.object]) info.describe(include=['category'])  

Çıktı

 categorical count 3 unique 3 top u freq 1  

Örnek4

 import pandas as pd import numpy as np a1 = pd.Series([1, 2, 3]) a1.describe() a1 = pd.Series(['p', 'q', 'q', 'r']) a1.describe() info = pd.DataFrame({'categorical': pd.Categorical(['s','t','u']), 'numeric': [1, 2, 3], 'object': ['p', 'q', 'r'] }) info.describe() info.describe(include='all') info.numeric.describe() info.describe(include=[np.number]) info.describe(include=[np.object]) info.describe(include=['category']) info.describe(exclude=[np.number]) info.describe(exclude=[np.object])  

Çıktı

 categorical numeric count 3 3.0 unique 3 NaN top u NaN freq 1 NaN mean NaN 2.0 std NaN 1.0 min NaN 1.0 25% NaN 1.5 50% NaN 2.0 75% NaN 2.5 max NaN 3.0