windng
Check-in [3c239ab4d0]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Keyword start cannot be '' in pandas.date_range()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3c239ab4d0e5971f713f88462673c73f8644bc0b
User & Date: goyo 2015-10-19 12:53:34
Context
2015-10-19
12:56
get_filepath_or_buffer() now returns compression. check-in: 6a263362aa user: goyo tags: trunk
12:53
Keyword start cannot be '' in pandas.date_range() check-in: 3c239ab4d0 user: goyo tags: trunk
12:48
Keyword percentile_width has been removed from DataFrame.describe(). check-in: 852760bfc6 user: goyo tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/test_flags.py.

143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

        result = flags.constant_values(s, window=4, threshold=0.2)
        expected = pd.Series([1, 1, 1, 1, 1, 1, 0, 0, 0, 0],
            index=index).astype(bool)
        pdt.assert_series_equal(result, expected)

        # ticket acf539f7f1
        index = pd.date_range('', periods=6, freq='10T')
        s = pd.Series([6.4, 6.4, 0, 0, 0, 0], index=index)
        result = flags.constant_values(s, window=3)
        expected = pd.Series([False, False, True, True, True, True],
            index=index)
        pdt.assert_series_equal(result, expected)


if __name__ == '__main__':
    unittest.main()







|









143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

        result = flags.constant_values(s, window=4, threshold=0.2)
        expected = pd.Series([1, 1, 1, 1, 1, 1, 0, 0, 0, 0],
            index=index).astype(bool)
        pdt.assert_series_equal(result, expected)

        # ticket acf539f7f1
        index = pd.date_range('2000-01-01', periods=6, freq='10T')
        s = pd.Series([6.4, 6.4, 0, 0, 0, 0], index=index)
        result = flags.constant_values(s, window=3)
        expected = pd.Series([False, False, True, True, True, True],
            index=index)
        pdt.assert_series_equal(result, expected)


if __name__ == '__main__':
    unittest.main()

Changes to test/test_oldflags.py.

1
2
3
4
5
6
7
8
9
10
11
12
13
..
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# test_oldflags.py
#
# Copyright 2013-2014 Goyo <goyodiaz@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
................................................................................

    def test_time_segments_2(self):
        """Another test of function time_segments."""
        # This is why we construct a list instead of a generator at the
        # beginning of time_segments.
        cond = pd.Series(
            data=[False, True] * 3,
            index=pd.date_range(start='', periods=6, freq='10T')
        )
        segments = flags.time_segments(cond)
        expected = cond.index[1::2]
        self.assertTrue((segments.start == expected).all())
        self.assertTrue((segments.end == expected).all())







|







 







|







1
2
3
4
5
6
7
8
9
10
11
12
13
..
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# test_oldflags.py
#
# Copyright 2013-2015 Goyo <goyodiaz@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
................................................................................

    def test_time_segments_2(self):
        """Another test of function time_segments."""
        # This is why we construct a list instead of a generator at the
        # beginning of time_segments.
        cond = pd.Series(
            data=[False, True] * 3,
            index=pd.date_range(start='2000-01-01', periods=6, freq='10T')
        )
        segments = flags.time_segments(cond)
        expected = cond.index[1::2]
        self.assertTrue((segments.start == expected).all())
        self.assertTrue((segments.end == expected).all())