Share via


DataFrame.LoadCsvFromString Method

Definition

Reads CSV data passed in as a string into a DataFrame.

public static Microsoft.Data.Analysis.DataFrame LoadCsvFromString (string csvString, char separator = ',', bool header = true, string[] columnNames = default, Type[] dataTypes = default, long numberOfRowsToRead = -1, int guessRows = 10, bool addIndexColumn = false, bool renameDuplicatedColumns = false, System.Globalization.CultureInfo cultureInfo = default);
static member LoadCsvFromString : string * char * bool * string[] * Type[] * int64 * int * bool * bool * System.Globalization.CultureInfo -> Microsoft.Data.Analysis.DataFrame
Public Shared Function LoadCsvFromString (csvString As String, Optional separator As Char = ',', Optional header As Boolean = true, Optional columnNames As String() = Nothing, Optional dataTypes As Type() = Nothing, Optional numberOfRowsToRead As Long = -1, Optional guessRows As Integer = 10, Optional addIndexColumn As Boolean = false, Optional renameDuplicatedColumns As Boolean = false, Optional cultureInfo As CultureInfo = Nothing) As DataFrame

Parameters

csvString
String

csv data passed in as a string

separator
Char

column separator

header
Boolean

has a header or not

columnNames
String[]

column names (can be empty)

dataTypes
Type[]

column types (can be empty)

numberOfRowsToRead
Int64

number of rows to read not including the header(if present)

guessRows
Int32

number of rows used to guess types

addIndexColumn
Boolean

add one column with the row index

renameDuplicatedColumns
Boolean

If set to true, columns with repeated names are auto-renamed.

cultureInfo
CultureInfo

culture info for formatting values

Returns

DataFrame

Applies to