Skip to content

read_fwf engine issue #8422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pmart123 opened this issue Sep 29, 2014 · 3 comments
Closed

read_fwf engine issue #8422

pmart123 opened this issue Sep 29, 2014 · 3 comments
Labels
IO CSV read_csv, to_csv Usage Question

Comments

@pmart123
Copy link

I am trying to use read_fwf to read in a fixed with text data file. I am hoping to use the dtype argument, which only works with the 'c' engine parser. I tried something like the following:

df = pd.read_fwf(dpath,widths=widths,header=0,skiprows=[0,2,3],thousands=',',engine='c',dtype={'cusip':str})

I received an error that the dtype option is not supported with the 'python-fwf' engine. As I understand, in the API docs, it says the c engine is necessary for the dtype argument. Is there no 'c' engine for read_fwf at the current moment, is is something else going on? I am using Pandas 14.1, python 3.4 as part of the Ancacondas distribution.

@TomAugspurger
Copy link
Contributor

Correct, there is not a dtype argument for read_fwf.

@jreback jreback added IO CSV read_csv, to_csv Usage Question labels Sep 29, 2014
@jreback
Copy link
Contributor

jreback commented Sep 29, 2014

fyi, this is a dupe of #7141

@jreback jreback closed this as completed Sep 29, 2014
@jreback
Copy link
Contributor

jreback commented Sep 29, 2014

master issue is #5232

essentially someone needs to implement dtype=... for the python parser (its all python code, so pretty straightforward)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv Usage Question
Projects
None yet
Development

No branches or pull requests

3 participants