Implementation:Evidentlyai Evidently Dataset As Dataframe
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Data_Engineering, LLM_Evaluation |
| Last Updated | 2026-02-14 12:00 GMT |
Overview
Concrete method for extracting the underlying pandas DataFrame from an Evidently Dataset provided by the Evidently library.
Description
Dataset.as_dataframe() returns the underlying pandas DataFrame including all computed descriptor columns. It is an abstract method on Dataset implemented by PandasDataset.
Usage
Call on a Dataset object to retrieve the full DataFrame with computed descriptor columns.
Code Reference
Source Location
- Repository: evidently
- File: src/evidently/core/datasets.py
- Lines: L1297-1304 (abstract), L1622 (PandasDataset implementation)
Signature
class Dataset:
@abstractmethod
def as_dataframe(self) -> pd.DataFrame:
"""Get the underlying pandas.DataFrame with all computed descriptors."""
Import
from evidently import Dataset
# as_dataframe() is called on a Dataset instance
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (none) | No parameters required |
Outputs
| Name | Type | Description |
|---|---|---|
| return value | pd.DataFrame | Full DataFrame with original + computed descriptor columns |
Usage Examples
from evidently import Dataset, DataDefinition
from evidently.descriptors import Sentiment, NegativityLLMEval
dataset = Dataset.from_pandas(
df,
data_definition=DataDefinition(),
descriptors=[
Sentiment("response"),
NegativityLLMEval("response"),
],
)
# Extract DataFrame with computed scores
eval_df = dataset.as_dataframe()
print(eval_df[["response", "Sentiment", "Negativity"]].head())
# Use for database storage
for _, row in eval_df.iterrows():
insert_into_db(row["Sentiment"], row["Negativity"])
Related Pages
Implements Principle
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment