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

Tyopescript compatible new column / generateSeris #144

Open
YousefED opened this issue May 29, 2022 · 1 comment
Open

Tyopescript compatible new column / generateSeris #144

YousefED opened this issue May 29, 2022 · 1 comment

Comments

@YousefED
Copy link

I've tried the examples at https://github.com/data-forge/data-forge-ts/blob/master/docs/guide.md#generating-a-column, but both options don't work nicely with TypeScript

  • The first option (withSeries) doesn't compile (see below)
  • The second option (generateSeries), doesn't result in a DataFrame with the correct type

(compilation error:

TS2322: Type '(df: IDataFrame<any, any>) => IDataFrame<any, any>' is not assignable to type 'ISeries<any, any> | SeriesSelectorFn<any, any, any>'.   Type '(df: IDataFrame<any, any>) => IDataFrame<any, any>' is not assignable to type 'SeriesSelectorFn<any, any, any>'.     Type 'IDataFrame<any, any>' is missing the following properties from type 'ISeries<any, any>': amountRange, proportionRange, percentRange, amountChange, and 24 more.

)

What's the typescript-way to add a new column based on the existing df?

@ashleydavis
Copy link
Member

Please submit example code so I can diagnose the error.

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