You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-7-ee89993a8718> in <module>
2from collections import OrderedDict
3 DataFrame.from_dict(
----> 4 OrderedDict([('b', 8), ('a', 5), ('a', 6)]))
~\Anaconda3\lib\site-packages\pandas\core\frame.py in from_dict(cls, data, orient, dtype, columns)
983raiseValueError('only recognize index or columns for orient')
984
--> 985 return cls(data, index=index, columns=columns, dtype=dtype)
986987defto_dict(self, orient='dict', into=dict):
~\Anaconda3\lib\site-packages\pandas\core\frame.py in __init__(self, data, index, columns, dtype, copy)
346 dtype=dtype, copy=copy)
347elifisinstance(data, dict):
--> 348 mgr = self._init_dict(data, index, columns, dtype=dtype)
349elifisinstance(data, ma.MaskedArray):
350import numpy.ma.mrecords as mrecords
~\Anaconda3\lib\site-packages\pandas\core\frame.py in _init_dict(self, data, index, columns, dtype)
457 arrays = [data[k] for k in keys]
458
--> 459 return _arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype)
460461def_init_ndarray(self, values, index, columns, dtype=None, copy=False):
~\Anaconda3\lib\site-packages\pandas\core\frame.py in _arrays_to_mgr(arrays, arr_names, index, columns, dtype)
7354 # figure out the index, if necessary
7355 if index is None:
-> 7356 index = extract_index(arrays)
7357
7358 # don't force copy because getting jammed in an ndarray anyway
~\Anaconda3\lib\site-packages\pandas\core\frame.py in extract_index(data)
7391
7392 if not indexes and not raw_lengths:
-> 7393 raise ValueError('If using all scalar values, you must pass'
7394 ' an index')
7395
ValueError: If using all scalar values, you must pass an index
Expected Output
Output of pd.show_versions()
[paste the output of pd.show_versions() here below this line]
The text was updated successfully, but these errors were encountered:
see also #22705
Code Sample, a copy-pastable example if possible
Note: code sample from exisiting test...
pandas/pandas/tests/frame/test_constructors.py
Lines 1436 to 1437 in 638ddeb
Problem description
Expected Output
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here below this line]The text was updated successfully, but these errors were encountered: