toypandas.dataframe

Descrizione modulo

Module Contents

Classes

Dataframe

Representation of a table, composed of rows and columns.

Locating

Index-based locator for Dataframes

Functions

concat(*args)

Concatenate an arbitrary number of Series or Dataframes into a single Dataframe.

read_csv(csv, **kwargs)

Read data from a csv file.

toypandas.dataframe.concat(*args)

Concatenate an arbitrary number of Series or Dataframes into a single Dataframe.

Parameters:

arg – Series or Dataframes.

Returns:

A single Dataframe, containing all values provided.

Return type:

Dataframe

toypandas.dataframe.read_csv(csv, **kwargs)

Read data from a csv file.

Parameters:
  • csv (str) – Path to the csv file.

  • kwargs – Descrizione 2.

Returns:

A Dataframe reprentation of the csv.

Return type:

Dataframe

class toypandas.dataframe.Dataframe(*args)

Bases: pandas.core.frame.DataFrame

Representation of a table, composed of rows and columns.

property indexlocate: Locating

Locate a row by index.

Returns:

The row (Series).

Return type:

Locating

show()

Print the contents of the Dataframe to screen

append(other)

Appends the values of other to the current Dataframe. If other is a Series, add a single row at the end with the values contained in the Series, otherwise it works exactly like concat.

If appending data of different sizes, excess values will be ignored, while missing values will become NaN.

Parameters:

other (toypandas.series.Series | Dataframe) – Series or Dataframe to append.

drop(item)

Drop the specified row or column

Parameters:

item – Number of the row or name of the column.

dropna(index)

Drop all rows or columns containing at least one Null or NaN value.

Parameters:

index (int) – If 0 drop by row, if 1 drop by column.

Returns:

A Dataframe (or Series, if only one column remains) without null values.

Return type:

toypandas.series.Series | Dataframe

drop_duplicates()

Remove duplicate rows from a Dataframe.

Returns:

A Dataframe with no duplicate rows, or a Series if only one row remained.

Return type:

toypandas.series.Series | Dataframe

isnull()

Returns a Dataframe indicating which values are missing (NaN or None).

Returns:

a Dataframe indicating which values are missing.

rename(old_name, new_name)

Rename a column from old_name to new_name.

Parameters:
  • old_name (str) – The old name of the column.

  • new_name (str) – The new name of the column.

class toypandas.dataframe.Locating(val)

Bases: pandas.core.indexing._iLocIndexer

Index-based locator for Dataframes

__getitem__(*args)

Return the element(s) in the required position(s).

Parameters:

args – Index of the row to return or condition to apply to whole Dataframe.

Returns:

The element(s) in the required position(s).

Return type:

toypandas.series.Series | Dataframe

__setitem__(*args)

Set the given position to the given value.

Parameters:

args – Position and new value.

Returns:

The Dataframe.

Return type:

Dataframe