Integer parameter in pandas DataFrame.drop function
<p>In following line of code</p>

<pre><code> X = np.array(df.drop(['label'], 1))
</code></pre>

<p>Could you please explain what does number <code>1</code> do? </p>

<p>From documentation I understand that <code>DataFrame.drop</code> function drops desired column named <code>'label'</code> from dataframe and returns new dataframe without this column. But I dont understand what does this particular integer parameter <code>1</code> do.</p>

<p>It is parameter <code>axis</code> in <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.drop.html" rel="nofollow"><code>drop</code></a>. It is same as <code>axis=1</code>. And it means you need remove columns from <code>DataFrame</code> which are specify in first parameter <code>labels</code>:</p>

<p><code>labels</code> is omited most times.<br>
Parameter <code>axis</code> can be removed if need remove row with <code>index</code>, because by default <code>axis=0</code>.
Parameter <code>axis=1</code> is sometimes replaced by <code>1</code>, because less text, but it is worse readable.</p>

<p>Sample:</p>

<pre><code>import pandas as pd

df = pd.DataFrame({'label':[1,2,3],
                   'label1':[4,5,6],
                   'label2':[7,8,9]})

print (df)
   label  label1  label2
0      1       4       7
1      2       5       8
2      3       6       9

print (df.drop(['label'], 1))
   label1  label2
0       4       7
1       5       8
2       6       9

#most commonly used
print (df.drop(['label'], axis=1))
   label1  label2
0       4       7
1       5       8
2       6       9

print (df.drop(labels=['label'], axis=1))
   label1  label2
0       4       7
1       5       8
2       6       9
</code></pre>

python pandas dataframe int multiple-columns