You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def create_dataframe(index, columns) -> DataFrame:
"""Combining the index and columns in a dataframe and return the datframe.
Parameters
----------
index : array-like, Series, or list of arrays/Series
Values to group by in the rows.
columns : array-like, Series, or list of arrays/Series
Values to group by in the columns.
Returns
-------
Dataframe
Table of the index and columns combined.
"""
if isinstance(index, list):
index_df = pd.concat(index, axis=1)
elif isinstance(index, pd.Series):
index_df = pd.DataFrame({index.name: index})
if isinstance(columns, list):
columns_df = pd.concat(columns, axis=1)
elif isinstance(columns, pd.Series):
columns_df = pd.DataFrame({columns.name: columns})
data = pd.concat([index_df, columns_df], axis=1)
return data
The text was updated successfully, but these errors were encountered:
def create_dataframe(index, columns) -> DataFrame:
"""Combining the index and columns in a dataframe and return the datframe.
The text was updated successfully, but these errors were encountered: