Issue
I use jupyter notebook I am trying to read CSV from network
data= pd.read_csv('\cdtvnas13\scor\ML Projects\Data\Input\', sep='\t',
encoding='utf-16_le')
The result is :
File "<ipython-input-8-5f26daf531ba>", line 2
crosswalk = pd.read_csv('\cdtvnas13\ACOEAnalytics\ML
Projects\Data\Input\', sep='\t', encoding='utf-16_le')
^
IndentationError: expected an indented block
I looked and tried so many tips but without success ...
Thak you for advice
Solution
Change your path to :
data= pd.read_csv('/cdtvnas13/scor/ML Projects/Data/Input/', sep='\t', encoding='utf-16_le')
as it's escaping on some of the characters, specifically the last single quote \'
gets evaluated to just '
which is not the desired behaviour, also check your indentation and put everything on a single line unless you need to line break the command in which case add a line break (see this )
data= pd.read_csv('/cdtvnas13/scor/ML Projects/Data/Input/', \ # <- this adds a line break continuation character
sep='\t', encoding='utf-16_le')
Also read_csv
expects the full path/url to an actual file, you can't provide just a folder path so you should do something like
data= pd.read_csv('/cdtvnas13/scor/ML Projects/Data/Input/mycsv.csv', sep='\t', encoding='utf-16_le')
Answered By - EdChum
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.