The percentile function was added in version 1.5.x. You will need to upgrade to at least that version.

Did you try:

sudo pip install numpy==1.7.1 --upgrade

To check which version you are running, start the python console and run:

>>> import numpy
>>> print numpy.__version__

You can also do:

sudo pip freeze | grep numpy

The Ubuntu 9.10 numpy package uses version 1.3.03. It is likely that installing version 1.7.0 vai pip was successful, but your machine is defaulting to the python-numpy version instead. You can remove by running:

sudo apt-get remove python-numpy
Answer from Nathan Villaescusa on Stack Overflow
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 0.23 › generated › pandas.Series.quantile.html
pandas.Series.quantile — pandas 0.23.1 documentation
Release Notes · Enter search terms or a module, class or function name. Series.quantile(q=0.5, interpolation='linear')[source]¶ · Return value at the given quantile, a la numpy.percentile. See also · pandas.core.window.Rolling.quantile · Examples · >>> s = Series([1, 2, 3, 4]) >>> s.quantile(.5) 2.5 >>> s.quantile([.25, .5, .75]) 0.25 1.75 0.50 2.50 0.75 3.25 dtype: float64 ·
🌐
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.Series.quantile.html
pandas.Series.quantile — pandas 3.0.2 documentation
If q is an array, a Series will be returned where the index is q and the values are the quantiles, otherwise a float will be returned. ... Calculate the rolling quantile. ... Returns the q-th percentile(s) of the array elements.
🌐
GitHub
github.com › aertslab › pySCENIC › issues › 350
AttributeError: 'numpy.ndarray' object has no attribute 'quantile' when doing nGenesDetectedPerCell.quantile() · Issue #350 · aertslab/pySCENIC
December 22, 2021 - AttributeError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_20596/2572477736.py in <module> 1 # STEP 4: Cellular enrichment (aka AUCell) from CLI 2 nGenesDetectedPerCell = np.sum(adata.X>0, axis=1) ----> 3 percentiles = nGenesDetectedPerCell.quantile([.01, .05, .10, .50, 1]) 4 print(percentiles) AttributeError: 'numpy.ndarray' object has no attribute 'quantile' Expected behavior I call np.quantile, it works <function numpy.quantile(a, q, axis=None, out=None, overwrite_input=False, interpolation='linear', keepdims=False)>. It should print like this: 0.01 473.58 0.05 1192.00 0.10 1390.90 0.50 1939.00 1.00 3998.00 dtype: float64 ·
Author   hyjforesight
🌐
GitHub
github.com › tensorflow › probability › issues › 1770
tfd.Empirical raises an AttributeError with quantile() · Issue #1770 · tensorflow/probability
November 16, 2023 - import tensorflow_probability as tfp tfd = tfp.distributions tfd.Empirical(samples=[1,2,3]).quantile(value=[0.1, 0.5]) >>>... File [~/.conda/envs/mpp/lib/python3.10/site-packages/tensorflow_probability/python/distributions/empirical.py:231], in Empirical._quantile(self, value, samples, **kwargs) 228 if samples is None: 229 samples = tf.convert_to_tensor(self._samples) --> 231 return quantiles.percentile( 232 x=samples, q=value * 100, axis=self._samples_axis, **kwargs) AttributeError: 'function' object has no attribute 'percentile'
Author   yusukemh
🌐
GitHub
github.com › llSourcell › Kaggle_Earthquake_challenge › issues › 3
module 'numpy' has no attribute 'quantile' · Issue #3 · llSourcell/Kaggle_Earthquake_challenge
Having the attribute error with the message: " module 'numpy' has no attribute 'quantile' " even after the updated version of Numpy.
🌐
Pandas
pandas.pydata.org › pandas-docs › version › 0.23.4 › generated › pandas.Series.quantile.html
pandas.Series.quantile — pandas 0.23.4 documentation
Release Notes · Enter search terms or a module, class or function name. Series.quantile(q=0.5, interpolation='linear')[source]¶ · Return value at the given quantile, a la numpy.percentile. See also · pandas.core.window.Rolling.quantile · Examples · >>> s = Series([1, 2, 3, 4]) >>> s.quantile(.5) 2.5 >>> s.quantile([.25, .5, .75]) 0.25 1.75 0.50 2.50 0.75 3.25 dtype: float64 ·
🌐
Cumulative Sum
cumsum.wordpress.com › 2022 › 06 › 11 › pandas-attributeerror-series-object-has-no-attribute
[pandas] AttributeError: 'Series' object has no attribute
June 11, 2022 - AttributeError: ‘Series’ object has no attribute ‘b’ · The reason this errors out is that agg takes a Series object as parameter instead of a sub dataframe. And a Series object doesn’t have a column b. If you have a need to access ...
🌐
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.Series.describe.html
pandas.Series.describe — pandas 2.3.3 documentation
By default the lower percentile is 25 and the upper percentile is 75. The 50 percentile is the same as the median. For object data (e.g. strings or timestamps), the result’s index will include count, unique, top, and freq. The top is the most common value. The freq is the most common value’s frequency.
Find elsewhere
🌐
W3Schools
w3schools.com › python › pandas › ref_df_quantile.asp
Pandas DataFrame quantile() Method
If the q argument is a Float, the return value will be a Series object. If the q argument is an Array, the return value will be a DataFrame object. This function does NOT make changes to the original DataFrame object.
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.5.dev0 Manual
>>> import numpy as np >>> a = np.array([[10, 7, 4], [3, 2, 1]]) >>> a array([[10, 7, 4], [ 3, 2, 1]]) >>> np.quantile(a, 0.5) 3.5 >>> np.quantile(a, 0.5, axis=0) array([6.5, 4.5, 2.5]) >>> np.quantile(a, 0.5, axis=1) array([7., 2.]) >>> np.quantile(a, 0.5, axis=1, keepdims=True) array([[7.], [2.]]) >>> m = np.quantile(a, 0.5, axis=0) >>> out = np.zeros_like(m) >>> np.quantile(a, 0.5, axis=0, out=out) array([6.5, 4.5, 2.5]) >>> m array([6.5, 4.5, 2.5]) >>> b = a.copy() >>> np.quantile(b, 0.5, axis=1, overwrite_input=True) array([7., 2.]) >>> assert not np.all(a == b) See also numpy.percentile for a visualization of most methods.
🌐
Google Groups
groups.google.com › g › pyomo-forum › c › Org1bHNAds4
AttributeError: 'Series' object has no attribute 'is_expression_type'
ERROR: Rule failed when generating expression for constraint File "C:\Users\Armaghan Bhr\Anaconda3\envs\dhopt\lib\site-packages\pyomo\core\base\constraint.py", line 779, in construct bbThor._bc_temp_out1 with index ('supply', 1): AttributeError: 'Series' ndx) object has no attribute ...
🌐
Fast.ai
forums.fast.ai › part 1 (2020)
AttributeError: 'Series' object has no attribute [X] when preparing DataBlock - Part 1 (2020) - fast.ai Course Forums
December 13, 2020 - I am having trouble running some basic code. I have a DataFrame called papers with one column called abstracts, and I am trying to create a DataBlock to load it in a model. I prepare the data (in a Kaggle notebook with the Arxiv dataset) as a Dataframe as import json data_file = '../input/arxiv/arxiv-metadata-oai-snapshot.json' def get_metadata(): with open(data_file, 'r') as f: for line in f: yield line metadata = get_metadata() titles = [] abstracts = ...
🌐
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.DataFrame.quantile.html
pandas.DataFrame.quantile — pandas 3.0.2 documentation
>>> df = pd.DataFrame( ... { ... "A": [1, 2], ... "B": [pd.Timestamp("2010"), pd.Timestamp("2011")], ... "C": [pd.Timedelta("1 days"), pd.Timedelta("2 days")], ... } ... ) >>> df.quantile(0.5, numeric_only=False) A 1.5 B 2010-07-02 12:00:00 C 1 days 12:00:00 Name: 0.5, dtype: object
🌐
GitHub
github.com › pycaret › pycaret › issues › 746
'Series' object has no attribute '_data' -- Loaded Model fails to predict when loaded on Windows but works on Linux · Issue #746 · pycaret/pycaret
October 21, 2020 - from pycaret.classification import * import pandas as pd import numpy as np Angebote = pd.read_excel('Predictions.xlsx') model = load_model('models/Calibrated_k_restricted_no_SMOTENC/et') predict_model(model, Angebote) ... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-4-39445baf673a> in <module> 7 model = load_model('models/Calibrated_k_restricted_no_SMOTENC/et') 8 ----> 9 predict_model(model, Angebote) ~\Anaconda3\lib\site-packages\pycaret\classification.py in predict_model(estimator, data, probabili
Author   ealvarezj
🌐
GitHub
github.com › theislab › scvelo › issues › 811
Errors with pandas 1.4 · Issue #811 · theislab/scvelo
January 24, 2022 - import scanpy as sc import scvelo as scv adata = scv.datasets.pancreas() scv.pp.filter_and_normalize(adata, min_shared_counts=20, n_top_genes=2000) scv.pp.moments(adata, n_pcs=30, n_neighbors=30) sc.pl.umap(adata, color = 'clusters') #Works as it should scv.pl.umap(adata, color = 'clusters') #Results in AttributeError: 'Series' object has no attribute 'categories' scv.tl.velocity(adata) #Results in AttributeError: 'Series' object has no attribute 'categories'
Author   karlann
🌐
GitHub
github.com › dusty-nv › jetson-inference › issues › 1640
AttributeError: 'Series' object has no attribute 'iteritems' · Issue #1640 · dusty-nv/jetson-inference
May 13, 2023 - File "open_images_downloader.py", line 212, in log_counts(annotations[dataset_type]['ClassName']) File "open_images_downloader.py", line 80, in log_counts for k, count in values.value_counts().iteritems(): File "/usr/local/lib/python3.8/dist-packages/pandas/core/generic.py", line 5989, in getattr return object.getattribute(self, name) AttributeError: 'Series' object has no attribute 'iteritems' I read somewhere that the newer version of pandas doesn't have iteritems() any longer but now uses items() instead.
Published   May 13, 2023
Author   githubwalt
🌐
Xarray
docs.xarray.dev › en › stable › generated › xarray.DataArray.quantile.html
xarray.DataArray.quantile
If False (default), the new object will be returned without attributes. skipna (bool or None, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have ...
Top answer
1 of 4
17

In relatively recent pandas version, 1.5.2, append works, but gives a warning.

In pd 2.0, append has been removed

https://pandas.pydata.org/docs/dev/whatsnew/v2.0.0.html#deprecations

In [14]: students_classes = pd.Series({'Alice': 'Physics',
    ...:                    'Jack': 'Chemistry',
    ...:                    'Molly': 'English',
    ...:                    'Sam': 'History'})
    ...: kelly_classes = pd.Series(['Philosophy', 'Arts', 'Math'], index=['Kelly', 'Kelly', 'Kelly'])

In [15]: students_classes.append(kelly_classes)
C:\Users\paul\AppData\Local\Temp\ipykernel_6072\990183765.py:1: FutureWarning: The series.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
  students_classes.append(kelly_classes)
Out[15]: 
Alice       Physics
Jack      Chemistry
Molly       English
Sam         History
Kelly    Philosophy
Kelly          Arts
Kelly          Math
dtype: object

Under the covers, append method uses _append, which works without raising the warning:

In [16]: students_classes._append(kelly_classes)
Out[16]: 
Alice       Physics
Jack      Chemistry
Molly       English
Sam         History
Kelly    Philosophy
Kelly          Arts
Kelly          Math
dtype: object

And using the recommended concat:

In [18]: pd.concat([students_classes,kelly_classes])
Out[18]: 
Alice       Physics
Jack      Chemistry
Molly       English
Sam         History
Kelly    Philosophy
Kelly          Arts
Kelly          Math
dtype: object

Python lists have an efficient append method. numpy has a np.append function which is a poorly named cover for calling np.concatenate, and is often misused (it shouldn't be used iteratively). pandas may be trying to avoid similar problems by getting rid of the append method. With pd.concat you can join many Series (or frames) at once, and aren't (as) tempted to use it in a loop.

Looking up the code for _append (which is still in 2.0), I see it ends up using pd.concat. So there's no value in using this 'work-around'. Use concat as recommended.

2 of 4
4

Probably an update of pandas may have changed the syntax, but you probably are looking for:

all_students_classes = students_classes._append(kelly_classes)

(quick tip, you can check the class definition in VS code by right cliking on the pd.Series and choosing Go to Definition, then you can see some of the methods defined at least). Otherwise use the concat method that uses this.