Skip to content

Instantly share code, notes, and snippets.

@luisquintanilla
Created June 10, 2022 17:49
Show Gist options
  • Save luisquintanilla/726701be6d89de6ea1be5ea933edf174 to your computer and use it in GitHub Desktop.
Save luisquintanilla/726701be6d89de6ea1be5ea933edf174 to your computer and use it in GitHub Desktop.
.NET DataFrame Load Wiki Detox Dataset Error
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
}
},
"source": [
"#i \"nuget:https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json\"\n",
"\n",
"#r \"nuget:Microsoft.Data.Analysis,0.20.0-preview.22309.2\""
],
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/html": "<div><div><strong>Restore sources</strong><ul><li><span>https://pkgs.dev.azure.com/dnceng/public/_packaging/MachineLearning/nuget/v3/index.json</span></li></ul></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.Data.Analysis, 0.20.0-preview.22309.2</span></li></ul></div></div>"
},
"execution_count": 1,
"metadata": {}
},
{
"output_type": "execute_result",
"data": {
"text/markdown": "Loading extensions from `Microsoft.Data.Analysis.Interactive.dll`"
},
"execution_count": 1,
"metadata": {}
}
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
}
},
"source": [
"using Microsoft.Data.Analysis;"
],
"outputs": []
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
}
},
"source": [
"#!value --name sentiment_data --from-url \"https://raw.githubusercontent.com/dotnet/machinelearning/main/test/data/wikipedia-detox-250-line-data.tsv\""
],
"outputs": []
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
}
},
"source": [
"#!share sentiment_data --from value"
],
"outputs": []
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
}
},
"source": [
"var data = DataFrame.LoadCsvFromString(sentiment_data, separator: '\\t');"
],
"outputs": [
{
"output_type": "error",
"ename": "",
"evalue": "System.Exception: Line 83 cannot be parsed with the current Delimiters.\r\n at Microsoft.Data.Analysis.TextFieldParser.ParseDelimitedLine()\r\n at Microsoft.Data.Analysis.TextFieldParser.ReadFields()\r\n at Microsoft.Data.Analysis.DataFrame.ReadCsvLinesIntoDataFrame(WrappedStreamReaderOrStringReader wrappedReader, Char separator, Boolean header, String[] columnNames, Type[] dataTypes, Int64 numberOfRowsToRead, Int32 guessRows, Boolean addIndexColumn)\r\n at Microsoft.Data.Analysis.DataFrame.LoadCsvFromString(String csvString, Char separator, Boolean header, String[] columnNames, Type[] dataTypes, Int64 numberOfRowsToRead, Int32 guessRows, Boolean addIndexColumn)\r\n at Submission#6.<<Initialize>>d__0.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken)",
"traceback": [
null
]
}
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".NET (C#)",
"language": "C#",
"name": ".net-csharp"
},
"language_info": {
"file_extension": ".cs",
"mimetype": "text/x-csharp",
"name": "C#",
"pygments_lexer": "csharp",
"version": "8.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment