Python - AttributeError: type object 'DataFrame' has no attribute 'read_csv' I'm trying to create some charts using Python. I've this dataset in a CSV file:

Banana  Water   Rice
Rice    Water
Bread   Banana  Juice 


And I've this code:

 import numpy as np
    from pandas import DataFrame
    import matplotlib
    matplotlib.use('agg') # Write figure to disk instead of displaying (for Windows Subsystem for Linux)
    import matplotlib.pyplot as plt

    data = DataFrame.read_csv("test.csv", index_col=1, skiprows=1).T.to_dict()


But when I execute the code I'm getting the following error:

AttributeError: type object 'DataFrame' has no attribute 'read_csv'


How can I solve this problem?

Many thanks!
read_csv() is not available on DataFrame. to read csvs using pandas -

import pandas as pd
data = pd.read_csv("file_name")


if you check type(data), it will be pandas DataFrame.