File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 16
16
class TestFrameComparisons :
17
17
# Specifically _not_ flex-comparisons
18
18
19
+ def test_frame_in_list (self ):
20
+ # GH#12689 this should raise at the DataFrame level, not blocks
21
+ df = pd .DataFrame (np .random .randn (6 ,4 ), columns = list ('ABCD' ))
22
+ msg = "The truth value of a DataFrame is ambiguous"
23
+ with pytest .raises (ValueError , match = msg ):
24
+ df in [None ]
25
+
19
26
def test_comparison_invalid (self ):
20
27
def check (df , df2 ):
21
28
Original file line number Diff line number Diff line change 1
1
from datetime import datetime , timedelta
2
2
from io import StringIO
3
+ import random
3
4
import re
4
5
import sys
5
6
import textwrap
27
28
28
29
29
30
class TestDataFrameReprInfoEtc :
31
+
32
+ def test_repr_bytes_61_lines (self ):
33
+ # GH#12857
34
+ lets = 'ACDEFGHIJKLMNOP'
35
+ slen = 50
36
+ nseqs = 1000
37
+ words = [[random .choice (lets ) for x in range (slen )] for _ in range (nseqs )]
38
+ df = pd .DataFrame (words ).astype ('S1' )
39
+ assert (df .dtypes == 'S1' ).all ()
40
+ repr (df ) # smoke test
41
+
30
42
def test_repr_empty (self ):
31
43
# empty
32
44
foo = repr (DataFrame ()) # noqa
You can’t perform that action at this time.
0 commit comments