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

Unable to use extension methods in .NET Jupyter Kernel #85

Closed
4 of 13 tasks
jwood803 opened this issue Oct 12, 2019 · 1 comment
Closed
4 of 13 tasks

Unable to use extension methods in .NET Jupyter Kernel #85

jwood803 opened this issue Oct 12, 2019 · 1 comment

Comments

@jwood803
Copy link

Describe the bug

Testing out ML.NET with the .NET Jupyter Kernel and when trying to use the context.Data.LoadFromTextFile it gives the below error:

Unhandled Exception: (1,12): error CS1929: 'DataOperationsCatalog' does not contain a definition for 'LoadFromTextFile' and the best extension method overload 'TextLoaderSaverCatalog.LoadFromTextFile<HousingData>(DataOperationsCatalog, string, char, bool, bool, bool, bool)' requires a receiver of type 'DataOperationsCatalog'

I tried to add the context.Data as the first parameter to see if that works, but that results in a different error, which I'm thinking is because the LoadFromTextFile is an extension method.

Unhandled Exception: (1,25): error CS1501: No overload for method 'LoadFromTextFile' takes 7 arguments

Is there any way to use methods like these in the .NET Kernel?

Full notebook can be found here, if needed.

Did this error occur while using dotnet try or online?

  • dotnet-try
  • online

What kind of error was it?

  • User Interface (UI): For example the output never displayed
  • Service Error: For example "The service is temporarily unavailable. We are working on it"
  • Other:

Screenshots

If applicable, add screenshots to help explain your problem.

Please complete the following:

  • OS
    • Windows 10
    • macOS
    • Linux (Please specify distro)
    • iOS
    • Android
  • Browser
    • Chrome
    • Edge
    • Safari
@jonsequitur
Copy link
Contributor

You can fix it by changing the last line from

var data = context.Data.LoadFromTextFile<HousingData>( context.Data, "./housing.csv", ',', true, false, false, false);

to

var data = context.Data.LoadFromTextFile<HousingData>( "./housing.csv", ',', true, false, false, false);

@jonsequitur jonsequitur transferred this issue from dotnet/try Jan 24, 2020
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