A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/3682 below:

DataFrame.from_records doesn't get dtype from empty ndarray · Issue #3682 · pandas-dev/pandas · GitHub

a = np.array([(1, 2)], dtype=[('id', np.int64), ('value', np.int64)])
df = pd.DataFrame.from_records(a, index='id') # ok

b = np.array([], dtype=[('id', np.int64), ('value', np.int64)])
df = pd.DataFrame.from_records(b, index='id') # KeyError: 'id'

The cause is _to_arrays checks for empty data before understanding that ndarray was passed.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4