python


Pandas CParseError, file downloaded via FTP


I am trying to read a csv file (downloaded via FTP )in Pandas using read_csv
df = pandas.read_csv("file.csv")
but I get error :
CParserError: Error tokenizing data. C error: EOF inside string starting at line 652
The code to download the file via FTP:
f = open(file_name, 'wb')
ftp.retrbinary("RETR " + file_name, f.write)
But when I download the same file on browser and parse it, it does fine. Please suggest any solution.
Try this instead:
df = pandas.read_csv('ftp://...') # puth there the real FTP URL
from docs:
filepath_or_buffer : str, pathlib.
Path, py._path.local.LocalPath or any object with a read() method (such as a file handle or StringIO)
The string could be a URL. Valid URL schemes include http, ftp,
s3, and file.
For file URLs, a host is expected. For instance, a local
file could be file ://localhost/path/to/table.csv

Related Links

trouble with mousewheel + scrollbars in tkinter
Python Cutting a string on a certain point
Ansible become_user error UnicodeEncodeError: 'ascii' codec can't encode character
Dynamic way to create new columns as a function of existing columns in pandas
polymorphic dispatch: distinguishing Python integers vs. floating-point numbers vs. strings
HTCondor output files: obtain created directory
getting select values with flask [duplicate]
Tensorflow tf.matmul example is incorrect?
drawing flower with python turtle
Python while loop iteration does not work
Rows not displaying properly in Tkinter GUI
Getting InvalidArgumentError in Tensorflow
Django - 2 URLS with same regex, but different variables and views
Parse headers with urllib2 if there is a duplicate [duplicate]
Python histogram outline
python IDLE changing default open file location to u C:\Users\user\documents

Categories

HOME
payment-gateway
openssl
tinyos
system-verilog
thunderbird-addon
parse-server
concourse
apple-numbers
sequelize.js
urlencode
internet-explorer-11
unity2d
click
wicket
gatsby
onsen-ui2
automata
local
symfony-forms
event-log
scaling
cairo
primes
osmdroid
image-quality
unpack
upnp
fetch-api
pentaho-report-designer
vertex-buffer
positioning
fractals
hotmail
salesforce-chatter
boilerplate
xen
forecasting
soundjs
stereo-3d
service-fabric-stateful
ivona
nsjsonserialization
nstouchbar
sapui
mbaas
visual-studio-templates
qos
pdfkit
atlassian-crowd
push-diffusion
tomee
audioqueue
spoofing
project-online
remoteapp
picking
inet
flexjson
cmocka
brackets-shell
galaxy
void
asymptote
data-import
jenkins-scriptler
zuora
mogrify
prezto
uos
shift-jis
and-operator
adaptive-compression
boost-test
wss
data-generation
slick-2.0
sim900
html-form-post
surveyor-gem
sharpmap
arbor.js
android-4.0
returnurl
concurrent-programming
entity-framework-ctp5
flash-cs5.5
ubuntu-11.04
electronic-signature
serp
paintcomponent
chatroom
scala-2.8
openwysiwyg
system-codedom-compiler
ajaxpro

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html