8000 ValueError: setting an array element with a sequence. · Issue #9156 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content
ValueError: setting an array element with a sequence. #9156
Closed
@cancan101

Description

@cancan101

This works fine:

In [24]: np.asarray(np.array([np.asarray([10, 20])]), np.float32)

Out[24]:
array([[ 10.,  20.]], dtype=float32)

but this does not work:

In [25]: np.asarray(pd.Series([np.asarray([10, 20])]), np.float32)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-25-afb8b06bdf8c> in <module>()
----> 1 np.asarray(pd.Series([np.asarray([10, 20])]), np.float32)

/usr/local/lib/python2.7/dist-packages/numpy/core/numeric.pyc in asarray(a, dtype, order)
    460 
    461     """
--> 462     return array(a, dtype, copy=False, order=order)
    463 
    464 def asanyarray(a, dtype=None, order=None):

ValueError: setting an array element with a sequence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compatpandas objects compatability with Numpy or Python functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0