title: Deleta a row with 'del' command in pandas
body: <p>Upon reading <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.drop.html" rel="nofollow noreferrer">pandas.dataframe.drop</a>, </p>
  
  <p>a column could be removed by drop or del</p>
  
  <pre><code>#+begin_src ipython :session alinbx :results output
  import pandas as pd
  import numpy as np
  
  df = pd.DataFrame(np.arange(12).reshape(3, 4),
                    columns=['A', 'B', 'C', 'D'])
  print(df, '\n'+'--'*50)
  # Drop columns
  print(df.drop(['B', 'C'], axis=1), '\n'+'--'*50)
  del df['A']
  # Drop a row by index
  print(df.drop([0, 1]), '\n'+'--'*50)
  print(df.drop([0, 1], axis=0))
  #+end_src
  
  #+RESULTS:
  #+begin_example
     A  B   C   D
  0  0  1   2   3
  1  4  5   6   7
  2  8  9  10  11 
  ----------------------------------------------------------------------------------------------------
     A   D
  0  0   3
  1  4   7
  2  8  11 
  ----------------------------------------------------------------------------------------------------
     B   C   D
  2  9  10  11 
  ----------------------------------------------------------------------------------------------------
     B   C   D
  2  9  10  11
  #+end_example
  </code></pre>
  
  <p>When try to delete a rwo with del, it report error </p>
  
  <pre><code>#+begin_src ipython :session alinbx :results output
  del df.iloc[0, :]
  #+end_src
  
  AttributeErrorTraceback (most recent call last)
  &lt;ipython-input-20-4fdbabf9cb4f&gt; in &lt;module&gt;
  ----&gt; 1 del df.iloc[0, :]
  
  AttributeError: __delitem__
  </code></pre>
  
  <p>How could delete a row with 'del`</p>