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/6240 below:

duplicate columns and drop buggy · Issue #6240 · pandas-dev/pandas · GitHub

In [21]: df = DataFrame({'A' : np.random.randn(5),
 'B' : np.random.randn(5),'C' : np.random.randn(5), 
  'D':['a','b','c','d','e'] })

In [22]: df
Out[22]: 
          A         B         C  D
0 -0.941264  0.272726 -0.547948  a
1  0.069432  1.398414  0.039093  b
2 -0.073638 -1.264676 -1.339994  c
3  1.520017 -0.562979 -0.739326  d
4 -0.395157  0.542807  0.766582  e

[5 rows x 4 columns]

In [23]: df.take([2,0,1,2,3], axis=1).drop('C',axis=1)
Out[23]: 
          A         B  D
0 -0.941264  0.272726  a
1  0.069432  1.398414  b
2 -0.073638 -1.264676  c
3  1.520017 -0.562979  d
4 -0.395157  0.542807  e

[5 rows x 3 columns]

In [24]: df.take([2,0,1,2,1], axis=1).drop('C',axis=1)
IndexError: index 3 is out of bounds for axis 0 with size 3

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