Skip to content

TSV

Properties

delimiter

php
public string $delimiter

Inherited methods

fromFilePath

php
public static fromFilePath(string $path): static
  • This method is static.

Parameters:

ParameterTypeDescription
$pathstring

fromFileInfo

php
public static fromFileInfo(\SplFileInfo $file): static
  • This method is static.

Parameters:

ParameterTypeDescription
$file\SplFileInfo

fromString

php
public static fromString(string $input): static
  • This method is static.

Parameters:

ParameterTypeDescription
$inputstring

convertSplFileToString

php
protected convertSplFileToString(): string

import

php
public import(\MammothPHP\WoollyM\DataFrame $to = new DataFrame()): \MammothPHP\WoollyM\DataFrame

Parameters:

ParameterTypeDescription
$to\MammothPHP\WoollyM\DataFrame

toArray

php
public toArray(): array

fromDataFrame

php
public static fromDataFrame(\MammothPHP\WoollyM\DataFrame $df): static
  • This method is static.

Parameters:

ParameterTypeDescription
$df\MammothPHP\WoollyM\DataFrame

prepareToFileInput

php
protected prepareToFileInput(mixed $file, bool $overwriteFile): \SplFileObject|false

Parameters:

ParameterTypeDescription
$filemixed
$overwriteFilebool

fromCsvReader

php
public static fromCsvReader(\League\Csv\Reader $csvReader): static
  • This method is static.

Parameters:

ParameterTypeDescription
$csvReader\League\Csv\Reader

fromStream

php
public static fromStream(mixed $stream): static
  • This method is static.

Parameters:

ParameterTypeDescription
$streammixed

format

Format options. If a parameter is null, default value or set previous parameter set for object will be applied.

php
public format(string $delimiter = self::DEFAULT_DELIMITER, string $enclosure = self::DEFAULT_ENCLOSURE, string $escape = self::DEFAULT_ESCAPE, mixed $headerOffset = self::DEFAULT_HEADER_OFFSET, mixed $columns = self::DEFAULT_COLUMNS, mixed $mapping = self::DEFAULT_MAPPING): static

Parameters:

ParameterTypeDescription
$delimiterstring
$enclosurestring
$escapestring
$headerOffsetmixed- To be 0 if no header line is present, else number of lines to ignore
$columnsmixed- Ordered array of columns, only if $headerOffset is false
$mappingmixed- Change a colonne name to another

filter

Filter CSV input

php
public filter(mixed $onlyColumns): static

Parameters:

ParameterTypeDescription
$onlyColumnsmixed- Restrict import to theses columns, as column string name from header or $columns

applyOptions

php
protected applyOptions(\League\Csv\AbstractCsv $csv): void

Parameters:

ParameterTypeDescription
$csv\League\Csv\AbstractCsv

ReaderFromFileObject

php
protected ReaderFromFileObject(bool& $applyOptions): void

Parameters:

ParameterTypeDescription
$applyOptionsbool

ReaderFromString

php
protected ReaderFromString(): void

ReaderFromStream

php
protected ReaderFromStream(): void

importFromCsvReader

php
protected importFromCsvReader(\MammothPHP\WoollyM\DataFrame $to): \MammothPHP\WoollyM\DataFrame

Parameters:

ParameterTypeDescription
$to\MammothPHP\WoollyM\DataFrame

toFile

Write CSV from dataFrame to a file

php
public toFile(string|\SplFileInfo|\League\Csv\Writer $file, bool $overwriteFile = false, bool $writeHeader = true): void

Parameters:

ParameterTypeDescription
$filestring|\SplFileInfo|\League\Csv\Writer
$overwriteFilebool
$writeHeaderbool

toStream

Write CSV from dataFrame to a stream resource

php
public toStream(mixed $phpStream, bool $writeHeader = true): void

Parameters:

ParameterTypeDescription
$phpStreammixed
$writeHeaderbool

toString

Write CSV from dataFrame to a string

php
public toString(bool $writeHeader = true): string

Parameters:

ParameterTypeDescription
$writeHeaderbool

writeCsv

php
protected writeCsv(\League\Csv\Writer $writer, bool $writeHeader): void

Parameters:

ParameterTypeDescription
$writer\League\Csv\Writer
$writeHeaderbool


Automatically generated on 2024-07-03

Released under the BSD 3-Clause License.