Yes, besides NumPy, you can also use the pandas library to calculate percentiles. Here's an example:
import pandas as pd
data = pd.Series([10, 15, 20, 25, 30, 35, 40, 45, 50])
# Calculate the 25th percentile
percentile_25 = data.quantile(0.25)
print("25th percentile:", percentile_25)
# Calculate the 50th percentile (median)
median = data.median()
print("Median:", median)
# Calculate the 75th percentile
percentile_75 = data.quantile(0.75)
print("75th percentile:", percentile_75)
The output will be the same as the previous example.
In this case, we create a pandas Series called data and use the quantile() method to calculate the desired percentiles.