Skip to content

Commit 0071de3

Browse files
code sample for pandas-dev#42456
1 parent 72a2a2a commit 0071de3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bisect/42456.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# BUG: Regression on DataFrame.from_records #42456
2+
3+
from numpy import empty, array
4+
import pandas as pd
5+
print(pd.__version__)
6+
7+
structured_dtype = [("prop", int)]
8+
9+
# Does NOT work any more
10+
result = empty((0, len(structured_dtype)))
11+
structured_array = array(result, dtype=structured_dtype)
12+
result = pd.DataFrame.from_records(structured_array)
13+
print(result)

0 commit comments

Comments
 (0)