BabyPandas Documentation¶
Release: | 1.0 |
---|---|
Date: | Nov 01, 2022 |
babypandas
is a pandas
data-analysis module with a restricted API.
This module is a simplified version of pandas
with only methods deemed necessary for an introductory course. babypandas
methods also only contain the necessary arguments needed for basic table manipulation and visualization, reducing the complication found in pandas
. Writing this module as a restricted version of pandas
allows for an easy transition into pandas
.
Reference¶
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. |
Series¶
Summary of Series
methods for babypandas
. Series
are one-dimensional arrays with labeled indices.
Click a method to see its documentation.
Creation
Series.__init__ (**kwargs) |
Create an empty Series. |
Selection
Series.take (indices) |
Return the elements in the given positional indices. |
Series.sample ([n, replace, random_state]) |
Return a random sample of elements from a Series. |
Transformation
Series.apply (func) |
Invoke function on values of Series. |
Series.sort_values (*[, ascending]) |
Sort by the values. |
Series.describe () |
Generate descriptive statistics. |
Series.reset_index (*[, drop]) |
Reset the index. |
Plotting
Series.plot (*args, **kwargs) |
Series plotting accessor and method. |
IO
Series.to_csv ([path_or_buf, index]) |
Write object to a comma-separated values (csv) file. |
Series.to_numpy () |
A NumPy ndarray representing the values in this Series or Index. |
Calculations
Series.count () |
Return number of non-NA/null observations in the Series. |
Series.mean () |
Return the mean of the values for the requested axis. |
Series.median () |
Return the median of the values for the requested axis. |
Series.min () |
Return the minimum of the values in the Series. |
Series.max () |
Return the maximum of the values in the Series. |
Series.sum () |
Return the sum of the values in the Series. |
Series.abs () |
Return a Series with absolute numeric value of each element. |
GroupBy¶
Summary of DataFrameGroupBy
methods for babypandas
. DataFrameGroupBy
objects are returned by groupby
calls: DataFrame.groupby()
Click a method to see its documentation.
Calculations
DataFrameGroupBy.count () |
Compute count of group. |
DataFrameGroupBy.mean () |
Compute mean of group. |
DataFrameGroupBy.median () |
Compute median of group. |
DataFrameGroupBy.min () |
Compute min of group. |
DataFrameGroupBy.max () |
Compute max of group. |
DataFrameGroupBy.sum () |
Compute sum of group. |
DataFrameGroupBy.size () |
Compute group sizes. |