Skip to content
Texxl

From junior to geek the road is sleek

column

How to calculate percentile (quantile) for each column in pandas dataframe

December 7, 2021December 7, 2021 by admin

Here we calculate 0.9th quantile of each column in our dataframe: q = 0.9 for column in df: qr = df[column].quantile(q) print(f”{q*100}% are lower than {qr}”) Here’s a good example to understand quantiles.

Categories Pandas Tags calculate, column, dataframe, pandas, percentile, quantile

How to get column index number by column name in pandas

November 18, 2021 by admin

print(df.columns.get_loc(“column_name”))

Categories Pandas Tags column, get, index, name, number, pandas

Categories

  • C#
  • Database
    • MariaDB
    • mySQL
  • git
  • Networking
    • Linux
    • nginx
    • Windows Server
  • Python
    • Anaconda
    • Cython
    • dask
    • Machine Learning
    • Numba
    • numpy
    • Pandas
    • plotly
  • Software
  • Uncategorized
  • Wordpress

Archives

  • November 2022 (1)
  • September 2022 (4)
  • June 2022 (1)
  • May 2022 (1)
  • February 2022 (4)
  • December 2021 (5)
  • November 2021 (15)
  • October 2021 (5)
  • September 2021 (1)
  • August 2021 (3)
  • July 2021 (1)
  • June 2021 (10)
  • May 2021 (8)
  • April 2021 (5)

Popular Posts:

  • How to extract substring with regex in Python code
  • cannot import name ‘Client’ from partially initialized module ‘dask.distributed’ (most likely due to a circular import)
  • How to disable warnings in Python
  • How to read files from Google drive with Python with PyDrive
  • ModuleNotFoundError: No module named ‘pydrive’

9software.com - your one-stop software shop!

© 2023 Texxl • Built with GeneratePress