You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem for time series with multiple time stamps.
This is the data file:
06/01/04 10:11:46 1.2735 1.2737
06/01/04 10:11:47 1.2735 1.2737
06/01/04 10:11:48 1.2736 1.2738
06/01/04 10:11:50 1.2736 1.2738
06/01/04 10:11:50 1.2735 1.2737
then:
raw_data[:oldest]
fails with TypeError: unsupported operand type(s) for +: 'slice' and 'int'
as does
raw_data.ix[:oldest]
raw_data[oldest:]
does work, whereas
raw_data.ix[oldest:]
fails with IndexError: invalid slice
Cutting out the last entry things work again, e.g.
raw_data[:-1].ix[oldest:]
raw_data[:-1].ix[:oldest]
or
raw_data[:-1][oldest:]
raw_data[:-1][:oldest]
a (or the ?) get_slice-routines return a slice in these cases.
get_loc gives back a slice when there are non-unique indexes, not sure if
that routine(s) should be fixed or slice_locs
my workaround (?) is catching this in slice_loc but I guess the get_loc's should be fixed instead
--- /home/jgarcke/Prog/Packages/pandas-git/pandas/core/index.py
2012-06-26 14:10:12.107724998 +0200
+++ index.py 2012-06-26 16:47:19.917653332 +0200
@@ -1039,7 +1039,11 @@
beg_slice = 0
else:
try:
I have a problem for time series with multiple time stamps.
This is the data file:
06/01/04 10:11:46 1.2735 1.2737
06/01/04 10:11:47 1.2735 1.2737
06/01/04 10:11:48 1.2736 1.2738
06/01/04 10:11:50 1.2736 1.2738
06/01/04 10:11:50 1.2735 1.2737
raw_data = read_csv('bug_data',header=None, parse_dates=[[0,1]], sep=' ', index_col=0, dayfirst=True)
oldest=raw_data.index[-1]
then:
raw_data[:oldest]
fails with TypeError: unsupported operand type(s) for +: 'slice' and 'int'
as does
raw_data.ix[:oldest]
raw_data[oldest:]
does work, whereas
raw_data.ix[oldest:]
fails with IndexError: invalid slice
Cutting out the last entry things work again, e.g.
raw_data[:-1].ix[oldest:]
raw_data[:-1].ix[:oldest]
or
raw_data[:-1][oldest:]
raw_data[:-1][:oldest]
a (or the ?) get_slice-routines return a slice in these cases.
get_loc gives back a slice when there are non-unique indexes, not sure if
that routine(s) should be fixed or slice_locs
my workaround (?) is catching this in slice_loc but I guess the get_loc's should be fixed instead
--- /home/jgarcke/Prog/Packages/pandas-git/pandas/core/index.py
2012-06-26 14:10:12.107724998 +0200
+++ index.py 2012-06-26 16:47:19.917653332 +0200
@@ -1039,7 +1039,11 @@
beg_slice = 0
else:
try:
end_slice = len(self)
else:
try:
The text was updated successfully, but these errors were encountered: