**CCDF**graph in Python by reading data from a text file.

Anyway, I got an error "

**ValueError: setting an array element with a sequence**".

Can anyone help me?

Here is my code in python:

import matplotlib.pyplot as plt import numpy as np read = np.loadtxt('data.txt') with open('data.txt') as f: a = [map(float, line.split()) for line in f] sorted=np.sort(a) x2 = [] y2 = [] y = 0 for x in sorted: x2.extend([x,x]) print x2 y2.append(y) y += 1.0 / len(a) y2.append(y) plt.plot(x2,y2) plt.show()

And here is my text file:

9.500000000 2.500000000 3.500000000 4.500000000 6.500000000 1.500000000