There's a function called importdata on matlab that import data from ASCII files and put it in a structure with 2 variables: textdata and data. It automatically identify the format of data (string, float.. etc), headlines and delimiter. This function comes in handy for me so im searching if have something equivalent in python packages like numpy and scipy. Im using numpy.loadtxt, but sometimes i have to use skiprows,delimiter, usecols and dtype at the same time. Someone knows some function that identify it by a easier way?
Looks like pandas http://pandas.pydata.org might be the way to go, if you want a really seamless import. I've seen pandas handle all sorts of strange missing/malformed data gracefully. That said, you do have slightly more complicated data structures than you'd otherwise be looking at.
pandas.read_csv("file")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With