← run

bcb-0009

1.000
8/8 tests· lib-knowledge

Proposed solution

```python
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns


def task_func(list_of_pairs):
    """
    Create a Pandas DataFrame from a list of pairs and visualize the data using a bar chart.
    - The title of the barplot should be set to 'Category vs Value'`.

    Parameters:
    list_of_pairs (list of tuple): Each tuple contains:
        - str: Category name.
        - int: Associated value.

    Returns:
    tuple:
        - DataFrame: A pandas DataFrame with columns 'Category' and 'Value'.
        - Axes: A matplotlib Axes displaying a bar chart of categories vs. values.

    Requirements:
    - pandas
    - matplotlib.pyplot
    - seaborn

    Example:
    >>> list_of_pairs = [('Fruits', 5), ('Vegetables', 9)]
    >>> df, ax = task_func(list_of_pairs)
    >>> print(df)
         Category  Value
    0      Fruits      5
    1  Vegetables      9
    """
    # Create DataFrame from list of pairs
    df = pd.DataFrame(list_of_pairs, columns=['Category', 'Value'])
    
    # Create bar chart
    plt.figure(figsize=(10, 6))
    ax = sns.barplot(data=df, x='Category', y='Value')
    
    # Set title
    ax.set_title('Category vs Value')
    
    return df, ax
```

Test output (stdout)

........                                                                 [100%]
=============================== warnings summary ===============================
../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:88
../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:88
../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:88
../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:88
../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:88
  /home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:88: PyparsingDeprecationWarning: 'parseString' deprecated - use 'parse_string'
    parse = parser.parseString(pattern)

../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:92
../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:92
../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:92
../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:92
../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:92
  /home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_fontconfig_pattern.py:92: PyparsingDeprecationWarning: 'resetCache' deprecated - use 'reset_cache'
    parser.resetCache()

../../home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_mathtext.py:30
  /home/psc/miniconda3/envs/peakstone-bcb/lib/python3.10/site-packages/matplotlib/_mathtext.py:30: PyparsingDeprecationWarning: 'enablePackrat' deprecated - use 'enable_packrat'
    ParserElement.enablePackrat()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
8 passed, 11 warnings in 0.52s
System prompt
You are an expert programmer. Solve the task exactly as specified. Output your solution as fenced code blocks using the required file name(s) and the exact function/type signatures requested. Prefer correctness; do not include prose outside code unless asked.