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

How to sort keys of dict by values?
a data structure with key as a cluster of words and value as a single word or string
Disable python warnings only for specific module via commandline
Error running GAE tutorial code - Guestbook
How to create a running total- Python [closed]
Unbuffered Python Subrocess PIPE
Django runserver syntax error
How to parse the string into list of tuples
Make instance methods global in module?
try-finally with SqlAlchemy: is this a good habit?
Bokeh not handling colors properly with ColumnDataSource
Psychopy MovieStim3: pausing errors
Django Mysql Complex annotations require an alias
Django: Unresolved reference 'project_name' warning
Using pyspeech for text-to-speech in python 2.7 script [duplicate]
How do I click this button using Selenium Webdriver?

Categories

HOME
caching
wsdl
ncurses
bower
facebook-graph-api
google-contacts
smartphone
extract
rocketmq
quill
devstack
triggers
websphere-liberty
xcode8.3
diagram
vuex
uiactivityviewcontroller
pjsip
multiple-monitors
datagrip
sql-tuning
google-people
internet-explorer-8
boolean-expression
shippo
source-maps
delete-file
npm-install
printdocument
chrome-native-messaging
cgal
cell-array
encase
ipfw
pdflatex
web-audio-api
ocs
bigcartel
pmwiki
android-download-manager
poco-libraries
jquery-multidatespicker
pdftk
g1gc
lftp
archer
azure-availability-set
gd
appstore-approval
uiviewpropertyanimator
rhel6
dwarf
uicollectionviewlayout
settimeout
spark-cassandra-connector
gradle-release-plugin
picking
django-south
aerogear
asymptote
selendroid
sem
type-mismatch
ubercart
gray-code
hg-git
pgagent
tcpreplay
livechat
grunt-express
em
dalekjs
outline
adaptive-compression
spdy
wss
flash-cc
healthvault
confusion-matrix
convex-polygon
layered
goinstant
localtime
lame
soa-suite
fortran77
socketstream
selectmanycheckbox
qtembedded
posting
gtk2hs
pantheios
requestfactory
quick-search
communicationexception
graniteds
pci-bus
webrat
filetime
inline-if
weborb





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android


MS Developer
developer works
python
ios
c
html
jquery


RDBMS discuss