DataFrame.LoadCsv Method

Definition

Overloads

LoadCsv(Stream, Char, Boolean, String[], Type[], Int64, Int32, Boolean, Encoding)

Reads a seekable stream of CSV data into a DataFrame.

LoadCsv(String, Char, Boolean, String[], Type[], Int32, Int32, Boolean, Encoding)

Reads a text file as a DataFrame.

LoadCsv(Stream, Char, Boolean, String[], Type[], Int64, Int32, Boolean, Encoding)

Reads a seekable stream of CSV data into a DataFrame.

public static Microsoft.Data.Analysis.DataFrame LoadCsv (System.IO.Stream csvStream, char separator = ',', bool header = true, string[] columnNames = default, Type[] dataTypes = default, long numberOfRowsToRead = -1, int guessRows = 10, bool addIndexColumn = false, System.Text.Encoding encoding = default);
static member LoadCsv : System.IO.Stream * char * bool * string[] * Type[] * int64 * int * bool * System.Text.Encoding -> Microsoft.Data.Analysis.DataFrame
Public Shared Function LoadCsv (csvStream As Stream, 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 encoding As Encoding = Nothing) As DataFrame

Parameters

csvStream
Stream

stream of CSV data to be read in

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

encoding
Encoding

The character encoding. Defaults to UTF8 if not specified

Returns

DataFrame

DataFrame

Applies to

LoadCsv(String, Char, Boolean, String[], Type[], Int32, Int32, Boolean, Encoding)

Reads a text file as a DataFrame.

public static Microsoft.Data.Analysis.DataFrame LoadCsv (string filename, char separator = ',', bool header = true, string[] columnNames = default, Type[] dataTypes = default, int numRows = -1, int guessRows = 10, bool addIndexColumn = false, System.Text.Encoding encoding = default);
static member LoadCsv : string * char * bool * string[] * Type[] * int * int * bool * System.Text.Encoding -> Microsoft.Data.Analysis.DataFrame
Public Shared Function LoadCsv (filename As String, Optional separator As Char = ',', Optional header As Boolean = true, Optional columnNames As String() = Nothing, Optional dataTypes As Type() = Nothing, Optional numRows As Integer = -1, Optional guessRows As Integer = 10, Optional addIndexColumn As Boolean = false, Optional encoding As Encoding = Nothing) As DataFrame

Parameters

filename
String

filename

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)

numRows
Int32

number of rows to read

guessRows
Int32

number of rows used to guess types

addIndexColumn
Boolean

add one column with the row index

encoding
Encoding

The character encoding. Defaults to UTF8 if not specified

Returns

DataFrame

DataFrame

Applies to