Load ASCII data from a file and return it in a record array. If ``usemask=False`` a standard `recarray` is returned, if ``usemask=True`` a MaskedRecords array is returned. Parameters ---------- fname, kwargs : For a description of input parameters, see `genfromtxt`. S
(fname, **kwargs)
| 2478 | |
| 2479 | |
| 2480 | def recfromtxt(fname, **kwargs): |
| 2481 | """ |
| 2482 | Load ASCII data from a file and return it in a record array. |
| 2483 | |
| 2484 | If ``usemask=False`` a standard `recarray` is returned, |
| 2485 | if ``usemask=True`` a MaskedRecords array is returned. |
| 2486 | |
| 2487 | Parameters |
| 2488 | ---------- |
| 2489 | fname, kwargs : For a description of input parameters, see `genfromtxt`. |
| 2490 | |
| 2491 | See Also |
| 2492 | -------- |
| 2493 | numpy.genfromtxt : generic function |
| 2494 | |
| 2495 | Notes |
| 2496 | ----- |
| 2497 | By default, `dtype` is None, which means that the data-type of the output |
| 2498 | array will be determined from the data. |
| 2499 | |
| 2500 | """ |
| 2501 | kwargs.setdefault("dtype", None) |
| 2502 | usemask = kwargs.get('usemask', False) |
| 2503 | output = genfromtxt(fname, **kwargs) |
| 2504 | if usemask: |
| 2505 | from numpy.ma.mrecords import MaskedRecords |
| 2506 | output = output.view(MaskedRecords) |
| 2507 | else: |
| 2508 | output = output.view(np.recarray) |
| 2509 | return output |
| 2510 | |
| 2511 | |
| 2512 | def recfromcsv(fname, **kwargs): |
nothing calls this directly
no test coverage detected