A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ydataai/ydata-profiling/commit/cf853bd2845ba4c8ea4860c8859396a45b933b54 below:

avoid failure when index level shares name with a column (#1673) · ydataai/ydata-profiling@cf853bd · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+21

-0

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+21

-0

lines changed Original file line number Diff line number Diff line change

@@ -35,6 +35,7 @@ def pandas_get_duplicates(

35 35

duplicated_rows = df.duplicated(subset=supported_columns, keep=False)

36 36

duplicated_rows = (

37 37

df[duplicated_rows]

38 +

.rename_axis(index=lambda _: None)

38 39

.groupby(supported_columns, dropna=False, observed=True)

39 40

.size()

40 41

.reset_index(name=duplicates_key)

Original file line number Diff line number Diff line change

@@ -0,0 +1,20 @@

1 +

import pandas as pd

2 +

import pytest

3 + 4 +

from ydata_profiling import ProfileReport

5 + 6 + 7 +

@pytest.fixture()

8 +

def df():

9 +

df = pd.DataFrame(

10 +

{

11 +

"foo": [1, 2, 3],

12 +

},

13 +

index=pd.Index([1, 2, 3], name="foo"),

14 +

)

15 +

return df

16 + 17 + 18 +

def test_index_column_name_clash(df: pd.DataFrame):

19 +

profile_report = ProfileReport(df, title="Test Report", progress_bar=False)

20 +

assert len(profile_report.to_html()) > 0

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4