File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 7
7
import io
8
8
9
9
from nose .tools import assert_equal , assert_raises , assert_false , assert_true
10
+ from nose .plugins .skip import SkipTest
10
11
11
12
import datetime
12
13
@@ -4183,6 +4184,23 @@ def test_broken_barh_empty():
4183
4184
ax .broken_barh ([], (.1 , .5 ))
4184
4185
4185
4186
4187
+ @cleanup
4188
+ def test_pandas_indexing_dates ():
4189
+ try :
4190
+ import pandas as pd
4191
+ except ImportError :
4192
+ raise SkipTest ("Pandas not installed" )
4193
+
4194
+ dates = np .arange ('2005-02' , '2005-03' , dtype = 'datetime64[D]' )
4195
+ values = np .sin (np .array (range (len (dates ))))
4196
+ df = pd .DataFrame ({'dates' : dates , 'values' : values })
4197
+
4198
+ ax = plt .gca ()
4199
+
4200
+ without_zero_index = df [np .array (df .index ) % 2 == 1 ].copy ()
4201
+ ax .plot ('dates' , 'values' , data = without_zero_index )
4202
+
4203
+
4186
4204
if __name__ == '__main__' :
4187
4205
import nose
4188
4206
import sys
You can’t perform that action at this time.
0 commit comments