Repository: evidentlyai/evidently
Issue: ValueError: PandasEngine works only with pd.DataFrame input data
Root cause: Interface Contract Mismatch

python version `3.9.21`

# define ref dataset
```
tr_ds_lr = Dataset.from_pandas(
    tr_data_lr,
    data_definition=DataDefinition()
)
```

# define cur dataset
```
te_ds_lr = Dataset.from_pandas(
    te_data_lr,
    data_definition=DataDefinition()
)
```

# defining report

```
report = Report(metrics=[
    # DataDriftPreset(num_stattest='jensenshannon', num_stattest_threshold=0.5, drift_share=0.5) 
    DataDriftPreset(num_stattest='wasserstein', num_stattest_threshold=0.5, drift_share=0.5)
]
)
```

# report run is throwin error
`report.run(reference_data=tr_ds_lr, current_data=te_ds_lr)`


Error Message,

````
ValueError                                Traceback (most recent call last)
Cell In[22], [line 1](vscode-notebook-cell:?execution_count=22&line=1)
----> [1](vscode-notebook-cell:?execution_count=22&line=1) report.run(reference_data=tr_ds_lr, current_data=te_ds_lr)

File c:\Users\40104089\AppData\Local\miniconda3\envs\drift-env\lib\site-packages\evidently\report\report.py:112, in Report.run(self, reference_data, current_data, column_mapping, engine, additional_data, timestamp)
    [110](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:110)     raise ValueError("No Engine is set")
    [111](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:111) else:
--> [112](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:112)     data_definition = self._inner_suite.context.get_data_definition(
    [113](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:113)         current_data,
    [114](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:114)         reference_data,
    [115](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:115)         column_mapping,
    [116](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:116)         self.options.data_definition_options.categorical_features_cardinality,
    [117](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:117)     )
    [118](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:118) if METRIC_GENERATORS in self.metadata:
    [119](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/report/report.py:119)     del self.metadata[METRIC_GENERATORS]

File c:\Users\40104089\AppData\Local\miniconda3\envs\drift-env\lib\site-packages\evidently\suite\base_suite.py:133, in Context.get_data_definition(self, current_data, reference_data, column_mapping, categorical_features_cardinality)
    [131](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/suite/base_suite.py:131)     if self.engine is None:
    [132](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/suite/base_suite.py:132)         raise ValueError("Cannot create data definition when engine is not set")
--> [133](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/suite/base_suite.py:133)     self.data_definition = self.engine.get_data_definition(
    [134](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/suite/base_suite.py:134)         current_data,
    [135](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/suite/base_suite.py:135)         reference_data,
    [136](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/suite/base_suite.py:136)         column_mapping,
    [137](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/suite/base_suite.py:137)         categorical_features_cardinality,
...
     [52](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/calculation_engine/python_engine.py:52)     ):
---> [53](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/calculation_engine/python_engine.py:53)         raise ValueError("PandasEngine works only with pd.DataFrame input data")
     [54](file:///C:/Users/40104089/AppData/Local/miniconda3/envs/drift-env/lib/site-packages/evidently/calculation_engine/python_engine.py:54)     return create_data_definition(reference_data, current_data, column_mapping, categorical_features_cardinality)

ValueError: PandasEngine works only with pd.DataFrame input data
```


Hi @neelkamalabi, 

It appears that you are mixing new Evidently API (e.g. using DataDefinition) and old Evidently API (by directly running the Report and using old parameter names).

I'd suggest you try the following:

- Make sure you have the latest version of Evidently (0.7.0 was released today) installed.

- Make sure you correctly import Report from this version

```
from evidently import Dataset
from evidently import DataDefinition
from evidently import Report
from evidently.presets import DataDriftPreset
```

(This would look differently if you use earlier versions)

- Create Evidently Datasets objects:

```
df_1 = Dataset.from_pandas(
    data,
    data_definition=DataDefinition(),
)
```

```
df_2 = Dataset.from_pandas(
    data,
    data_definition=DataDefinition(),
)
```

- Make sure you correctly use the Report object, check this quickstart https://docs.evidentlyai.com/quickstart_ml

You need to first define the Report, then create a run:

```
report = Report([
    DataDriftPreset()
])
my_eval = report.run(df_1, df_2)
```

To see the Report in Jupyter:

```
my_eval
```

- If you want to change drift methods, make sure you correctly use the drift parameters, see https://docs.evidentlyai.com/metrics/customize_data_drift#all-parameters 

```
report = Report([
    DataDriftPreset(num_method='wasserstein', num_threshold=0.5, drift_share=0.5)
])
my_eval = report.run(df_1, df_2)
my_eval
```

Thank you providing the solution. can you pls guide me to the doc for interpretability of graphs that we receive under "data drift" & "data distribution" tab. 

Example:
In the image below, how should I interpret distributions marked in yellow? Also, if you noticed, there seems to a bug, as with every value on x-axis, some strange characters are getting appended as prefix.
![Image](https://github.com/user-attachments/assets/1d636807-7c43-4b35-b1ef-203c8edd7442)

Hi @neelkamalabi,

These are value distributions, and they should be interpreted in the context of your task and the meaning of the feature.

- The top (“red”) mini-plots are independent distributions. They show how the values are distributed in the current and reference datasets separately, each binned into 10 bins based on their own internal ranges.
- The expanded chart below shows joint distributions, which are better for comparison - both current and reference datasets are binned using the same bins, making it easier to see differences.

In your example, the reference distribution is more spread out across a wider range, while the current distribution is concentrated in the specific value range - this kind of shift typically indicates data drift, assuming you compare two periods where you expect distributions to be similar.

You can also switch to percentage view (using the perc button) to normalize for volume differences between datasets.

Regarding the strange symbol on the x-axis: it’s a known Plotly rendering bug, where the Unicode minus sign (−) is incorrectly rendered as âˆ’. You can treat it as a negative value.