eland.DataFrame.quantile¶
-
DataFrame.
quantile
(q: Union[int, float, List[int], List[float]] = 0.5, numeric_only: Optional[bool] = True) → pandas.core.frame.DataFrame¶ Used to calculate quantile for a given DataFrame.
- Parameters
- q:
float or array like, default 0.5 Value between 0 <= q <= 1, the quantile(s) to compute.
- numeric_only: {True, False, None} Default is True
Which datatype to be returned - True: Returns all values as float64, NaN/NaT values are removed - None: Returns all values as the same dtype where possible, NaN/NaT are removed - False: Returns all values as the same dtype where possible, NaN/NaT are preserved
- Returns
- pandas.DataFrame
quantile value for each column
See also
Examples
>>> ed_df = ed.DataFrame('localhost', 'flights') >>> ed_flights = ed_df.filter(["AvgTicketPrice", "FlightDelayMin", "dayOfWeek", "timestamp"]) >>> ed_flights.quantile() # doctest: +SKIP AvgTicketPrice 640.387285 FlightDelayMin 0.000000 dayOfWeek 3.000000 Name: 0.5, dtype: float64
>>> ed_flights.quantile([.2, .5, .75]) # doctest: +SKIP AvgTicketPrice FlightDelayMin dayOfWeek 0.20 361.040768 0.0 1.0 0.50 640.387285 0.0 3.0 0.75 842.213490 15.0 4.0
>>> ed_flights.quantile([.2, .5, .75], numeric_only=False) # doctest: +SKIP AvgTicketPrice FlightDelayMin dayOfWeek timestamp 0.20 361.040768 0.0 1.0 2018-01-09 04:43:55.296587520 0.50 640.387285 0.0 3.0 2018-01-21 23:51:57.637076736 0.75 842.213490 15.0 4.0 2018-02-01 04:46:16.658119680