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

Why does it not work on eclipse using PyDev but works on mac terminal
python shell , cannot see what I type
How to append new contents to old cell contents using xlrd/xlwt python modules
Only one of the recipients receives email, why?
Rotate or overlay an PNG image while I see extra white or black spaces in opencv and python
Turning .py file into exe [duplicate]
Using a callback function to find the sum of values in a bst (without a global)
Append numeric value to binary string
string not returned from function, but list is returned
Circus WEBUI is not working
'NoneType' error
Fully authorize a local application using OAuth for tumblr
Convert Data Objects to Strings for Script
Python 3 pyOpenGL install problems
Can I validate Azure credentials without generating Certificate for my machine?
How to return the multiple indexes of word using .index in Python

Categories

HOME
cntk
uibutton
cpu-architecture
qpython3
wms
deep-linking
visualization
cocos2d-x-3.0
tomcat7
couchdb-2.0
java-home
bro
schemacrawler
vsftpd
powershell-v3.0
hashicorp-vault
ctypes
automata
maxima
webmethods
squarespace
sendkeys
netezza
ssms-2016
ada
chocolatey
pycrypto
thingsboard
fop
os161
servicemix
badge
multichoiceitems
sharp
spring-profiles
body-parser
shibboleth
oscommerce
readfile
coreclr
web-development-server
control-flow-graph
apiary
context-free-language
archer
ajp
walmart-electrode
pinvoke
persistent
maintenance
execl
teiid
alter
packagemaker
rstudio-server
inet
asynccallback
git-rebase
void
sourcegear-vault
windowlistener
calibration
ember-cli-addons
google-earth-plugin
hana-xs
lexicographic
inputaccessoryview
activity-streams
pgagent
gmaps4rails
scala-2.11
x-ua-compatible
grunt-express
sid
proxies
boost-test
ssms-addin
codeigniter-a3m
slick-2.0
late-static-binding
edit-in-place
confusion-matrix
loop-invariant
jqmobi
haskell-platform
ftp4j
dynamics-ax-2009
dwolla
fraud-prevention
fieldset
xml-libxml
template-haskell
vt100
moq-3
couchdb-lucene
plone-funnelweb
unions
ninject-extensions
selectonemenu
coff
curljs
executable-format
cookieless
rijndael
out-of-browser
external-assemblies
aio
scatterview
integer-promotion
nt4
dirty-data

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