A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/48296 below:

Adding a row via DataFrame.at · Issue #48296 · pandas-dev/pandas · GitHub

df = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
df.at[2] = [5, 6]

On 1.4.x, this gives

     a    b
0  1.0  3.0
1  2.0  4.0
2  5.0  6.0

whereas on 1.5.0rc0 it gives pandas.errors.InvalidIndexError: slice(None, None, None). I didn't any mention of this in the whatsnew, and a git bisect points at #47074; cc @jorisvandenbossche.

The docs of DataFrame.at explicitly say a KeyError is raised when the label is not in the frame. It seems to me this operation should not be supported, and can be considered a bugfix, but would be better to raise KeyError: label 2 not found.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4