DataFrame.LoadCsvFromString 方法

定义

将作为字符串传入的 CSV 数据读取到 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

参数

csvString
String

以字符串的形式传入的 csv 数据

separator
Char

列分隔符

header
Boolean

有标头与否

columnNames
String[]

列名 (可以为空)

dataTypes
Type[]

列类型 (可以为空)

numberOfRowsToRead
Int64

要读取的行数,不包括标头 ((如果存在)

guessRows
Int32

用于猜测类型的行数

addIndexColumn
Boolean

使用行索引添加一列

renameDuplicatedColumns
Boolean

如果设置为 true,则会自动重命名具有重复名称的列。

cultureInfo
CultureInfo

用于设置值格式的区域性信息

返回

DataFrame

适用于