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

Django - Keep line breaks when importing CSV file
How to extract and increment the hour from text (str) using Python
Imports recognized in Eclipse PyDev, but not in terminal
ADCPi- how to run without being root?
django clear form field after a submit
Pandas 0.14.1 StataReader - Reading .dta files
Odd Errors for Python installation library
Python Ubersmith API - Generate Invoice
Can/Why Does A Hard Drive Serial Number Change
Why does tuple(set([1,“a”,“b”,“c”,“z”,“f”])) == tuple(set([“a”,“b”,“c”,“z”,“f”,1])) 85% of the time with hash randomization enabled?
Pandas groupby and file writing problems
django: AppRegistryNotReady Exception after adding tastypie to INSTALLED APPS
django loading millions of rows
How to Write Unit Tests for Python Command Line Tool
Attaching a process with pdb
How to add additional column to Django QuerySet

Categories

HOME
cil
sidekiq
plsql
udp
redis
scipy
ubuntu-16.04
translation
reportportal
snap.svg
proguard
shader
contact-form-7
cartodb
ndis
wysiwyg
phoenix
line-api
scala-native
atlassian-plugin-sdk
ip-camera
shippo
richfaces
iis-10
java-ee-7
lync-2013
kong
codelite
edge-detection
idl
hawtio
office365connectors
sonarqube-scan
topic-modeling
jquery-multidatespicker
microdata
upsert
asmx
startapp
vcf
production-environment
bnd
struts-layout
fontconfig
opencpu
adler32
lotus
master
cfeclipse
uistackview
cron-task
faraday
dac
except
java.util.calendar
function-fitting
response-headers
qbfc
built-in
rx-groovy
pyopengl
magento-1.12
utf-32
cocoascript
tcpreplay
and-operator
x-ua-compatible
getimagedata
magic-numbers
dvcs
pyjade
angulartics
dllexport
javascriptmvc
google-closure-library
mailcore
device-emulation
concurrent-programming
pureftpd
msn
clients
trampolines
opcodes
web-analytics-tools





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