DataFrame.ReadCsv Method

Definition

Namespace: Extreme.DataAnalysis
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

ReadCsv(StreamReader, Boolean, Int32, CultureInfo, Boolean, Int32) Reads a data frame from a CSV file.
Obsolete.
ReadCsv(String, Boolean, Int32, CultureInfo, Boolean, Int32) Reads a data frame from a CSV file.
Obsolete.
ReadCsv<R>(StreamReader, String, Boolean, Boolean, Int32, CultureInfo, Boolean, Int32) Reads a data frame from a CSV file and uses the specified column as the row index.
Obsolete.
ReadCsv<R>(String, String, Boolean, Boolean, Int32, CultureInfo, Boolean, Int32) Reads a data frame from a CSV file and uses the specified column as the row index.
Obsolete.

DataFrame.ReadCsv(StreamReader, Boolean, Int32, CultureInfo, Boolean, Int32)

Note: This API is now obsolete.
Reads a data frame from a CSV file.
C#
[ObsoleteAttribute("Use the classes in the Extreme.Data package instead.")]
public static DataFrame<long, string> ReadCsv(
	StreamReader reader,
	bool hasHeaders = true,
	int skipLines = 0,
	CultureInfo culture = null,
	bool decimalAsDouble = true,
	int inferenceRows = 2147483647
)

Parameters

reader  StreamReader
A stream reader for the file.
hasHeaders  Boolean  (Optional)
Specifies whether the first record contains column headers. The default is true.
skipLines  Int32  (Optional)
The number of lines to skip at the beginning of the file. The default is 0.
culture  CultureInfo  (Optional)
The culture to use for parsing numbers and dates.
decimalAsDouble  Boolean  (Optional)
Specifies whether columns containing numbers with decimals should be returned as Double instead of Decimal.
inferenceRows  Int32  (Optional)
The number of records to use to infer the data types of the columns. The default is 10.

Return Value

DataFrame<Int64, String>
A data frame that contains the data in the CSV file.

Exceptions

IOException

The file could not be found.

FormatException

The file is not in the proper format.

DataFrame.ReadCsv(String, Boolean, Int32, CultureInfo, Boolean, Int32)

Note: This API is now obsolete.
Reads a data frame from a CSV file.
C#
[ObsoleteAttribute("Use the classes in the Extreme.Data package instead.")]
public static DataFrame<long, string> ReadCsv(
	string path,
	bool hasHeaders = true,
	int skipLines = 0,
	CultureInfo culture = null,
	bool decimalAsDouble = true,
	int inferenceRows = 2147483647
)

Parameters

path  String
The path to the file.
hasHeaders  Boolean  (Optional)
Specifies whether the first record contains column headers. The default is true.
skipLines  Int32  (Optional)
The number of lines to skip at the beginning of the file. The default is 0.
culture  CultureInfo  (Optional)
The culture to use for parsing numbers and dates.
decimalAsDouble  Boolean  (Optional)
Specifies whether columns containing numbers with decimals should be returned as Double instead of Decimal.
inferenceRows  Int32  (Optional)
The number of records to use to infer the data types of the columns. The default is 10.

Return Value

DataFrame<Int64, String>
A data frame that contains the data in the CSV file.

Exceptions

IOException

The file could not be found.

FormatException

The file is not in the proper format.

DataFrame.ReadCsv<R>(StreamReader, String, Boolean, Boolean, Int32, CultureInfo, Boolean, Int32)

Note: This API is now obsolete.
Reads a data frame from a CSV file and uses the specified column as the row index.
C#
[ObsoleteAttribute("Use the classes in the Extreme.Data package instead.")]
public static DataFrame<R, string> ReadCsv<R>(
	StreamReader reader,
	string keyColumn,
	bool dropKeyColumn = true,
	bool hasHeaders = true,
	int skipLines = 0,
	CultureInfo culture = null,
	bool decimalAsDouble = true,
	int inferenceRows = 10
)

Parameters

reader  StreamReader
A stream reader for the file.
keyColumn  String
The name of the column that contains the column keys.
dropKeyColumn  Boolean  (Optional)
If true, the key column is not included in the returned data frame.
hasHeaders  Boolean  (Optional)
Specifies whether the first record contains column headers. The default is true.
skipLines  Int32  (Optional)
The number of lines to skip at the beginning of the file. The default is 0.
culture  CultureInfo  (Optional)
The culture to use for parsing numbers and dates.
decimalAsDouble  Boolean  (Optional)
Specifies whether columns with decimal values should be returned as Double or Decimal.
inferenceRows  Int32  (Optional)
The number of records to use to infer the data types of the columns. The default is 10.

Type Parameters

R
The type of the row keys.

Return Value

DataFrame<R, String>
A data frame that contains the data in the CSV file.

Exceptions

KeyNotFoundException

A column named keyColumn was not found in the file.

IOException

The file could not be found.

FormatException

The file is not in the proper format.

DataFrame.ReadCsv<R>(String, String, Boolean, Boolean, Int32, CultureInfo, Boolean, Int32)

Note: This API is now obsolete.
Reads a data frame from a CSV file and uses the specified column as the row index.
C#
[ObsoleteAttribute("Use the classes in the Extreme.Data package instead.")]
public static DataFrame<R, string> ReadCsv<R>(
	string path,
	string keyColumn,
	bool dropKeyColumn = true,
	bool hasHeaders = true,
	int skipLines = 0,
	CultureInfo culture = null,
	bool decimalAsDouble = true,
	int inferenceRows = 10
)

Parameters

path  String
The path to the file.
keyColumn  String
The name of the column that contains the column keys.
dropKeyColumn  Boolean  (Optional)
If true, the key column is not included in the returned data frame.
hasHeaders  Boolean  (Optional)
Specifies whether the first record contains column headers. The default is true.
skipLines  Int32  (Optional)
The number of lines to skip at the beginning of the file. The default is 0.
culture  CultureInfo  (Optional)
The culture to use for parsing numbers and dates.
decimalAsDouble  Boolean  (Optional)
Specifies whether columns with decimal values should be returned as Double or Decimal.
inferenceRows  Int32  (Optional)
The number of records to use to infer the data types of the columns. The default is 10.

Type Parameters

R
The type of the row keys.

Return Value

DataFrame<R, String>
A data frame that contains the data in the CSV file.

Exceptions

KeyNotFoundException

A column named keyColumn was not found in the file.

IOException

The file could not be found.

FormatException

The file is not in the proper format.

See Also