DataFrame

Summary of DataFrame methods for babyandas. DataFrame are a two-dimensional tabular data structure with labeled rows (indices) and columns.

Click a method to see its documentation.

Creation

DataFrame.__init__(**kwargs) Create an empty DataFrame.
DataFrame.from_dict(data) Construct DataFrame from dict of array-like or dicts.
DataFrame.from_records(data, *[, columns]) Convert structured or record ndarray to DataFrame.
DataFrame.assign(**kwargs) Assign new columns to a DataFrame.

Selection

DataFrame.take(indices) Return the rows in the given positional indices.
DataFrame.drop(*[, columns]) Remove columns by specifying column names.
DataFrame.sample([n, replace, random_state]) Return a random sample of rows from a data frame.
DataFrame.get(key) Return column or columns from data frame.

Transformation

DataFrame.apply(func[, axis]) Apply a function along an axis of the DataFrame.
DataFrame.sort_values(by, *[, ascending]) Sort by the values in column(s) named in by.
DataFrame.describe() Generate descriptive statistics.
DataFrame.groupby(by) Group DataFrame by values in columns specified in by.
DataFrame.reset_index(*[, drop]) Reset the index.
DataFrame.set_index(keys[, drop]) Set the DataFrame index using existing columns.

Combining

DataFrame.merge(right[, how, on, left_on, …]) Merge DataFrame or named Series objects with a database-style join.
DataFrame.append(other[, ignore_index]) Append rows of other to the end of caller, returning a new object.

Plotting

DataFrame.plot(*args, **kwargs) DataFrame plotting accessor and method

IO

DataFrame.to_csv([path_or_buf, index]) Write object to a comma-separated values (csv) file.
DataFrame.to_numpy() Convert the DataFrame to a NumPy array.