8000 Adding Timeseries from .dt or toDateTime() to Series or DataFrame throws "Error: File format not supported!" · Issue #363 · javascriptdata/danfojs · GitHub
[go: up one dir, main page]

Skip to content
Adding Timeseries from .dt or toDateTime() to Series or DataFrame throws "Error: File format not supported!" #363
Closed
@Emporea

Description

@Emporea

I tested it with danfojs-node and danfojs-node-nightly, because danfo.Dt includes the nightly.

What I have so far is this. Not a dt or danfo.toDateTime() operation yet.

const danfo = require("danfojs-node-nightly");

let index = ["0", "1", "2", "3"];
let value = [
  "2018-11-30T20:59:00",
  "2018-10-30T20:59:00",
  "2018-09-30T20:59:00",
  "2018-08-30T20:59:00",
];

let sf = new danfo.Series(value, { index });

console.log(sf.dt);

This is working and gives this. Danfo succesfully recognizes this string as a date.

TimeSeries {
  '$dateObjectArray': [
    2018-11-30T20:59:00.000Z,
    2018-10-30T20:59:00.000Z,
    2018-09-30T20:59:00.000Z,
    2018-08-30T20:59:00.000Z
  ]
}

But if I have a DataFrame where one column are dates then it is not possible to insert it into the DataFrame.
Any single one of these functions results in the same error. Obviously only for demonstration all 4 in a row.

df["dates"] = df["dates"].dt
df["dates"] = danfo.toDateTime(dt["dates"])
let test_df = new danfo.DataFrame(sf.dt);
let test_sf = new danfo.Series(sf.dt);

Error: File format not supported!

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0