# module `homeblog.table_formula_stat`¶

## Short summary¶

module `ensae_teaching_cs.homeblog.table_formula_stat`

Contains TableFormulaStat.

source on GitHub

## Classes¶

class

truncated documentation

`_TableFormulaStat`

Contains various statistical functions.

## Methods¶

method

truncated documentation

`Gini`

computes the Gini, it calls GiniCurve (`GiniCurve()`), it takes the following parameters:

`GiniCurve`

Computes the Gini curve, takes the following parameters.

`summary`

produces a summary on each columns

`summary_column`

produces a summary of a column, it the column is numerical, it computes, the min, max, quantile, mean, med, std. …

## Documentation¶

Contains TableFormulaStat.

source on GitHub

class ensae_teaching_cs.homeblog.table_formula_stat._TableFormulaStat

Bases : `object`

Contains various statistical functions.

```table = TableFormula ("sum_y#1#1#1#1#1#1#1#1#1#1#1".replace(" ", "\t").replace("#","\n"))
gini = table.Gini (lambda v : v["sum_y"])
print (gini)  # expects 1

table = TableFormula ("sum_y#1#1#1#1#1#1#1#1#1#1#1#5#10".replace(" ", "\t").replace("#","\n"))
gini = table.Gini (lambda v : v["sum_y"])
print (gini) # expects much more less than 1
```

source on GitHub

Gini(functionY, functionX=None, isXdx=False)

computes the Gini, it calls GiniCurve (`GiniCurve`), it takes the following parameters:

Paramètres
• functionY – revenues

• functionX – sum of persons having an income below Y (or having Y is isXdx is True)

• isXdx – number of persons equal to Y (True) or inferior (False), if True, X,Y couples are sorted

Renvoie

a curve (x, Gini(x))

source on GitHub

GiniCurve(functionY, functionX=None, isXdx=False)

Computes the Gini curve, takes the following parameters.

Paramètres
• functionY – revenues

• functionX – sum of persons having an income below Y (or having Y is isXdx is True)

• isXdx – number of persons equal to Y (True) or inferior (False), if True, X,Y couples are sorted

Renvoie

a curve (x, Gini(x))

source on GitHub

summary()

produces a summary on each columns

Renvoie

TableFormulaStat

source on GitHub

summary_column(column_name)

produces a summary of a column, it the column is numerical, it computes, the min, max, quantile, mean, med, std. If it is not, count the number of distinct values. The function considers an empty column as a non-numerical column. The fonction do not consider None values.

Paramètres

column_name – column name

Renvoie

dictionary

source on GitHub
{"ft_lang_label":"__label__en","ft_lang_prob":0.5710648,"math_prob":0.8919363,"size":2200,"snap":"2022-05-2022-21","text_gpt3_token_len":635,"char_repetition_ratio":0.12659381,"word_repetition_ratio":0.5,"special_character_ratio":0.26181817,"punctuation_ratio":0.16709511,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9970417,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-23T12:18:05Z\",\"WARC-Record-ID\":\"<urn:uuid:7c12b6b3-f40e-4ef1-8892-4dbfc3970764>\",\"Content-Length\":\"26356\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6481bbcb-aef9-4be5-8320-109099e8fec7>\",\"WARC-Concurrent-To\":\"<urn:uuid:01ba349b-7c61-4222-9739-0fe44438212e>\",\"WARC-IP-Address\":\"51.159.6.59\",\"WARC-Target-URI\":\"http://www.xavierdupre.fr/app/ensae_teaching_cs/helpsphinx/ensae_teaching_cs/homeblog/table_formula_stat.html\",\"WARC-Payload-Digest\":\"sha1:CEN6BCZD7WF42QGTSEMZWVHJNE5T6TNL\",\"WARC-Block-Digest\":\"sha1:LQ6O5T3IUR2WS67TH2EERZ4RTAH4VB6E\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662558015.52_warc_CC-MAIN-20220523101705-20220523131705-00495.warc.gz\"}"}