python - load a float+ string table -


this question has answer here:

i have table contains both floats , strings. when i'm trying load np.loadtxt(file.txt), got error

could not convert string float: \omega_b 

how can fix it.

you can load using dtype option create structured array:

np.loadtxt(fname, dtype=[('col1_name', '|s10'), ('col2_name', float)]) 

or if don't want specify dtypes should use can go suggested @atomh33ls: dtype=none.

see additional options np.loadtxt can tune needs.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -