Python Forum
IndentationError when no problem with indentation
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IndentationError when no problem with indentation
#3
Thanks for your interest in assisting, ichabod; the code is below: (I'll note that the forum editor doesn't seem to allow me to include a blank line as the first line of the code, so what I reference as line 36 above is shown as line 35 below)

# In [1]

import os, sys, csv, gzip
import numpy as np
import pandas as pd
import scipy.sparse as sp
from scipy import io

import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams['pdf.fonttype'] = 42 ## Output Type 3 (Type3) or Type 42 (TrueType)
rcParams['font.sans-serif'] = 'Arial'
#matplotlib inline

from plots import COLORS10, enlarge_tick_fontsize
import seaborn as sns
sns.set_style('whitegrid')

from sklearn.cross_validation import (StratifiedKFold, cross_val_score)
from sklearn.metrics import *
from sklearn.decomposition import TruncatedSVD
from sklearn import ensemble
from sklearn.pipeline import Pipeline
import xgboost as xgb

# /Library/Python/2.7/site-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
#  "`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)

# ===============================================================================
# STAGE 1: ...
# ===============================================================================

# Load input file

labels = pd.read_csv('input.csv')
print (labels.shape)
labels.head()

# output: (232, 7) + a table
Reply


Messages In This Thread
RE: IndentationError when no problem with indentation - by BobLoblaw - Oct-07-2017, 06:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  IndentationError: unexpected indent Grin 3 4,921 May-15-2018, 06:49 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020