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

URL common name matching - Python
Odd digit count python
how to post in facebook group that's im member on it using facebook-sdk python
How to chunk up an interval in Python?
How to merge multiple dictionaries
Ubuntu does not find module directory containing __init__.py
How to detect frequencies with matplotlib spectrogram?
Python timeout decorator
boto3 changing AWS ec2 instance state
Inputing date using Selenium/Python does not work
Opening IDLE from Terminal
IP proto field number to string
Setting all dictionary elements to 0 python
Translate curl to python [duplicate]
Setting Values Of Inherited Properties
How do I make pip install binaries to a writable path?

Categories

HOME
makefile
payment-gateway
project-management
nlp
filterrific
itext
visual-studio-2013
backup
smartphone
otrs
jscript
onenote-api
aruco
google-plus
vuex
onsen-ui2
activesync
mule-studio
apache-karaf
attask
ejbca
esql
piwik
logarithm
python-textprocessing
excel-2013
spring-data-neo4j
dpi
blackboard
strophe
entity-system
spring-profiles
expand
ifstream
google-drive-realtime-api
gettext
sidr
openshift-enterprise
boilerplate
mmdrawercontroller
nlb
mongoexport
equivalence
visualstudio.testtools
intellilock
floating-accuracy
intellij-idea-2016
median
stress-testing
startapp
tuleap
drawingarea
uiviewpropertyanimator
applepayjs
pluck
etherpad
qos
gradle-script-kotlin
mongoose-populate
dts
bacnet
asteriskami
dbscan
spring-repositories
mongo-c-driver
direct3d12
windows-vista
js-cookie
apigee-baas
abas
twython
ffserver
ubercart
guzzle6
pl-i
candidate-key
firebug-lite
author
argument-passing
coin-flipping
android-looper
visual-c++-2010-express
bfd
windows-mobile-6
nsmatrix
nscolor
dig
iconv
dwolla
symphony-cms
fraud-prevention
magickwand
process-monitor
arbor.js
template-haskell
mvs
macruby
flexicious
viewdidload
serp
printing-web-page
email-spec
communicationexception
front-controller
rd

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
Mobile App
Mobile App
Mobile App