I am trying to remove the last line in dataframecreated by pandas in python, and it looks like you have problems.
index = DateRange('1/1/2000', periods=8)
df = DataFrame(randn(8, 3), index=index, columns=['A', 'B', 'C'])
I tried the drop method as follows:
df.drop([shape(df)[0]-1], axis = 0)
but he continues to say a label not contained in the axis.
I also tried to fall by index name and it still does not work.
Any advice would be appreciated. Thank!!!
source
share