Mira lo que surge:

$ python plot_bram.py -b bram_ac_real -f 50
Traceback (most recent call last):
  File "plot_bram.py", line 27, in <module>
    y = y.lstrip("0")
AttributeError: 'numpy.ndarray' object has no attribute 'lstrip'

Codigo:

cols = np.loadtxt(args.bram, dtype=str, usecols=[2,8])

x = cols[:,0]
y = cols[:,1]

max_x = np.argmax(y)

y = y.lstrip("0")

plt.plot(x,y)
plt.show()




El 29 de diciembre de 2015, 12:10, Juan Luis Cano <juanlu...@gmail.com>
escribió:

> On 2015-12-29 18:20, Rolando Paz wrote:
>
> Lo que entiendo que necesito es encontrar una función que elimine todos
> los ceros a la izquierda del signo menos.
>
>
> Tal vez puedes probar con
>
> >>> "00-4834129".lstrip("0")
> '-4834129'
>
> https://docs.python.org/3/library/stdtypes.html#str.lstrip
>
> Juan Luis
>
> _______________________________________________
> Python-es mailing list
> Python-es@python.org
> https://mail.python.org/mailman/listinfo/python-es
> FAQ: http://python-es-faq.wikidot.com/
>
>
_______________________________________________
Python-es mailing list
Python-es@python.org
https://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a