Index

class FilesIndex(*args, path=None, name=None)[source]

Index of local files.

Builds a DataFrame containing file paths and indexed by filnames.

Parameters
  • path (str) – Path to files that should be indexed. Path can contain shell-style wildcards.

  • name (str, optional) – Name for files collection.

index_merge(x)

Merge on left and right indexes.

property indices

Unique indices.

shuffle(seed=None)

Randomly shuffle indices.

Parameters

seed (int) – Seed for the random number generator.

Returns

index – BaseIndex with shuffled indices.

Return type

BaseIndex

train_test_split(train_ratio=0.8, shuffle=True, seed=None)

Splits index into train and test subsets.

Parameters
  • train_ratio (float, in [0, 1]) – Ratio of the train subset to the whole dataset. Default to 0.8.

  • shuffle (bool) – If True, index will be shuffled before splitting into train and test. Default to True.

  • seed (int) – Seed for the random number generator.

Returns

(train, test) – Train and test indices.

Return type

tuple

class RemoteFilesIndex(*args, url=None, ext=None, name=None)[source]

Index of remote files.

Builds a DataFrame containing urls and indexed by filnames.

Parameters
  • url (str) – URL where remote files are located.

  • ext (str) – Files extention.

  • name (str, optional) – Name for files collection.

index_merge(x)

Merge on left and right indexes.

property indices

Unique indices.

shuffle(seed=None)

Randomly shuffle indices.

Parameters

seed (int) – Seed for the random number generator.

Returns

index – BaseIndex with shuffled indices.

Return type

BaseIndex

train_test_split(train_ratio=0.8, shuffle=True, seed=None)

Splits index into train and test subsets.

Parameters
  • train_ratio (float, in [0, 1]) – Ratio of the train subset to the whole dataset. Default to 0.8.

  • shuffle (bool) – If True, index will be shuffled before splitting into train and test. Default to True.

  • seed (int) – Seed for the random number generator.

Returns

(train, test) – Train and test indices.

Return type

tuple

class KislovodskFilesIndex(*args, series=None, start_date=None, end_date=None, ext=None)[source]

Index for the archive of the Kislovodsk Mountain Astonomical Station.

Builds a DataFrame containing urls and indexed by filnames.

Parameters
  • series (str) – Data series. ‘spot’ for sunspots, ‘ca’ for plages, ‘fil’ for filaments, ‘ch’ for coronal holes.

  • start_date (str) – Start date, YYYY-MM-DD.

  • end_date (str) – End date, YYYY-MM-DD.

  • ext (str, optional) – Files extention.

index_merge(x)

Merge on left and right indexes.

property indices

Unique indices.

shuffle(seed=None)

Randomly shuffle indices.

Parameters

seed (int) – Seed for the random number generator.

Returns

index – BaseIndex with shuffled indices.

Return type

BaseIndex

train_test_split(train_ratio=0.8, shuffle=True, seed=None)

Splits index into train and test subsets.

Parameters
  • train_ratio (float, in [0, 1]) – Ratio of the train subset to the whole dataset. Default to 0.8.

  • shuffle (bool) – If True, index will be shuffled before splitting into train and test. Default to True.

  • seed (int) – Seed for the random number generator.

Returns

(train, test) – Train and test indices.

Return type

tuple