
import pandaview
import numpy as np
import pandas as pd

def create_test_df(rows=50):
    """
    Creates a dummy dataframe with various data types and scenarios
    to test the .see() function capabilities.
    
    Scenarios covered:
    - Unique columns (will be underlined)
    - Columns with NaN values (will be orange)
    - Different data types: integer, float, string, boolean, datetime, timedelta, categorical, list, mixed
    - Regular columns with duplicates
    
    Parameters:
    -----------
    rows : int, default 50
        Number of rows in the dataframe
    
    Returns:
    --------
    pd.DataFrame
        A dataframe with various columns covering all .see() scenarios
    """
    np.random.seed(42)
    
    # Prepare columns with NaN values
    int_with_nan = np.random.randint(1, 100, rows).astype(float)
    int_with_nan = [np.nan if i % 7 == 0 else x for i, x in enumerate(int_with_nan)]
    
    float_with_nan = np.random.randn(rows)
    float_with_nan = [np.nan if i % 5 == 0 else x for i, x in enumerate(float_with_nan)]
    
    datetime_with_nan = pd.date_range('2020-01-01', periods=rows, freq='D')
    datetime_with_nan = [pd.NaT if i % 8 == 0 else x for i, x in enumerate(datetime_with_nan)]
    
    data = {
        # Unique integer column (will be underlined)
        'unique_id': range(rows),
        
        # Integer column with duplicates
        'int_with_duplicates': np.random.randint(1, 10, rows),
        
        # Integer column with NaN values (will be orange)
        'int_with_nan': int_with_nan,
        
        # Float column
        'float_col': np.random.randn(rows),
        
        # Float column with NaN (will be orange)
        'float_with_nan': float_with_nan,
        
        # String column
        'string_col': [f'item_{i}' for i in range(rows)],
        
        # String column with duplicates
        'string_duplicates': np.random.choice(['A', 'B', 'C', 'D'], rows),
        
        # String column with NaN (will be orange)
        'string_with_nan': [f'text_{i}' if i % 6 != 0 else np.nan for i in range(rows)],
        
        # Boolean column
        'bool_col': np.random.choice([True, False], rows),
        
        # Boolean column with NaN (will be orange)
        'bool_with_nan': np.random.choice([True, False, None], rows),
        
        # Datetime column
        'datetime_col': pd.date_range('2020-01-01', periods=rows, freq='D'),
        
        # Datetime column with NaN (will be orange)
        'datetime_with_nan': datetime_with_nan,
        
        # Timedelta column
        'timedelta_col': pd.timedelta_range('1 days', periods=rows, freq='D'),
        
        # Categorical column
        'categorical_col': pd.Categorical(np.random.choice(['Low', 'Medium', 'High'], rows)),
        
        # List column (will have unique_count = 0)
        'list_col': [[i, i*2, i*3] for i in range(rows)],
        
        # Mixed type column (will have unique_count = 0)
        'mixed_col': [i if i % 3 == 0 else str(i) if i % 3 == 1 else float(i) for i in range(rows)],
        
        # Unique string column (will be underlined)
        'unique_string': [f'unique_{i}' for i in range(rows)],
    }
    
    df = pd.DataFrame(data)
    df.index.name = 'index_named'
    return df

create_test_df().see(3)