Convert a csv file so that all attributes will become columns with corresponding element so I have this dataset in a csv file. I would like to convert it into a matrix form.

The data currently looks like this:

University, adelphi
State,  newyork
Control,  private
No-of-Students, 5-10
Male:Female Ratio:, 30:70
Student:Faculty Ratio:, 15:1
Sat Verbal,  500
....
Academic-Emphasis,  business-administration
Academic-Emphasis,  biology

I would like to convert it so that the Attributes become columns and the elements on each corresponding row. Like in a excel sheet.

Example:

University | State   | Control | No-of-Students| ect.
adelphi    | newyork | private | 5-10          |

Thank you very mcuh for your help!
Here's two different ways to do it. One reading through the file one line at a time to generate a list of dictionaries and one using pure pandas;

import pandas as pd

with open('datafile.csv', 'r') as f:
    data = []
    current_university = {}
    for line in f:
        line = [x.lstrip().strip() for x in line.split(',')]
        if (line[0] == 'University'):
            if current_university:
                data.append(current_university)
            current_university = {line[0]: line[1]}
        else:
            current_university[line[0]] = line[1]
    data.append(current_university)
df = pd.DataFrame(data)
df.set_index('University', inplace=True)


And then pandas;

df = pd.read_csv('datafile.csv', header=None)
df = df.set_index(0).T
df = df.groupby(df.columns.values, axis=1).agg(lambda x: x.values.tolist()).sum().apply(pd.Series).T.sort_values('University')
df.set_index('University', inplace=True)


Personally I think it's much easier to see what's going on in the first option but just wanted to show that it can be done using only pandas as well.