This PR adds a Frame extension that can read CSV from a string.
Currently, two extra steps are needed to do that: reading the bytes from the string, and passing a MemoryStream based on that to Frame.ReadCsv:
let byteArray = Encoding.UTF8.GetBytes(dataString)
use stream = new MemoryStream(byteArray)
Frame.ReadCsv(stream,true,separators=",")
Why add this?
While this saves 'only' 2 LOC in scripts, this is a common operation when getting data via HTTP requests and therefore justifies the addition IMHO. This happens often when analyzing data from online sources. Examples where i use it can be seen in the Plotly.NET docs
I added a test based on the tests already implemented. If i should add more or change something, please let m know ;)
This PR adds a Frame extension that can read CSV from a string.
Currently, two extra steps are needed to do that: reading the bytes from the string, and passing a
MemoryStream
based on that toFrame.ReadCsv
:Why add this?
While this saves 'only' 2 LOC in scripts, this is a common operation when getting data via HTTP requests and therefore justifies the addition IMHO. This happens often when analyzing data from online sources. Examples where i use it can be seen in the Plotly.NET docs
I added a test based on the tests already implemented. If i should add more or change something, please let m know ;)