Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: File format not supported! while trying to reassign a column. #616

Open
SalamanderXing opened this issue Nov 6, 2023 · 1 comment

Comments

@SalamanderXing
Copy link

SalamanderXing commented Nov 6, 2023

Describe the bug
I'm trying to transform a column of a DataFrame:

import dfd from "danfojs-node";

const df = new dfd.DataFrame({
  a: [1, 2, 3],
  b: ["a", "b", "c"],
});

// ** METHOD 1 **
df["b"] = df["b"].map((value) => value.toUpperCase());

console.log(df["b"].values());
// error: File format not supported!

// ** METHOD 2 ** 
const transformed = df["b"].map((value) => value.toUpperCase());
df.addColumn(
  "b",
  transformed,
  { inplace: true },
);

console.log(df["b"].values());
// error: File format not supported!

Full error stack trace:

                throw new Error("File format not supported!");
                      ^

Error: File format not supported!
    at Series.NDframe (/home/bluesk/Documents/news_aggregator/news_
anfojs-base/core/generic.js:100:23)
    at new Series (/home/bluesk/Documents/news_aggregator/news_aggr
js-base/core/series.js:134:28)
    at DataFrame.$getColumnData (/home/bluesk/Documents/news_aggreg
ode/dist/danfojs-base/core/frame.js:196:24)
    at DataFrame.get (/home/bluesk/Documents/news_aggregator/news_a
nfojs-base/core/frame.js:147:37)
    at file:///home/bluesk/Documents/news_aggregator/news_aggregato
    at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:
    at async loadESM (node:internal/process/esm_loader:34:7)
    

To Reproduce
Run the above code.

Expected behavior
No error should be raised, I should be able to access the 'b' column and its values.

Desktop (please complete the following information):

  • OS: Linux
  • Nodejs Node.js v20.9.0
@vivere-dally
Copy link

Up, facing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants