Skip to content

Commit

Permalink
code sample for pandas-dev#42456
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed Jul 16, 2021
1 parent 72a2a2a commit 0071de3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bisect/42456.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# BUG: Regression on DataFrame.from_records #42456

from numpy import empty, array
import pandas as pd
print(pd.__version__)

structured_dtype = [("prop", int)]

# Does NOT work any more
result = empty((0, len(structured_dtype)))
structured_array = array(result, dtype=structured_dtype)
result = pd.DataFrame.from_records(structured_array)
print(result)

0 comments on commit 0071de3

Please sign in to comment.