Skip to content

Error creating string ND array #50

Closed
@19csi

Description

@19csi

Hi,

I'm trying to create an NDarray to store DateTime values from a normal C# array. When I try to create the NDarray I get the following error: Can not convert type of given object to dtype: System.String[].

            string[] times = new string[50];

            DateTime now = DateTime.Now;

            for (int i = 0; i < 50; i++)            
                times[i] = now.AddSeconds(i).ToString();            

            // Raises Exception
            NDarray<string> nTimes = np.array<string>(times);

When I try to make a NDarray<float> it works fine, but for NDarray<DateTime> and NDarray<string> this error occurs. Is there something I am doing wrong here or are these types not supported? Thanks for the help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions