pandas

pandas.DataFrame.rank

The rank method of a pandas DataFrame returns another pandas DataFrame in which the values are the result of assigning ranges (from 1 to n) to the values of the original DataFrame, considering them ordered, by default, from lowest to highest along axis 0. That is, the smallest value in a column receives rank 1, the next rank 2, and so on. The method parameter controls the method of assigning ranges to matching values.

The index of the original DataFrame is preserved. The assigned ranges are real numbers.

Submitted by admin on Fri, 01/15/2021 - 16:44

pandas.crosstab

The pandas.crosstab function returns the contingency table resulting from crossing two or more fields in a dataframe. Although, by default, the result evaluates the frequencies (absolute or relative) of each combination of values, it is possible to specify an aggregation function.

Submitted by admin on Fri, 11/13/2020 - 10:17

pandas.DataFrame.drop

The .drop() method associated with a pandas dataframe returns a copy of it after deleting the indicated rows or columns. These should be referenced by their explicit labels, not by their position on the axis.

The deletion is done, by default, on the vertical axis (rows are deleted, therefore).

Submitted by admin on Sat, 11/07/2020 - 13:46