Skip to main content
Active reading [<https://en.wikipedia.org/wiki/Pandas_%28software%29>].
Source Link
Peter Mortensen
  • 31.1k
  • 22
  • 111
  • 134

With pandasPandas,

wit column names

dataframe[['column1','column2']]

to select by iloc and specific columns with index number:

dataframe.iloc[:,[1,2]]

with loc column names can be used like

dataframe.loc[:,['column1','column2']]

With pandas,

wit column names

dataframe[['column1','column2']]

to select by iloc and specific columns with index number:

dataframe.iloc[:,[1,2]]

with loc column names can be used like

dataframe.loc[:,['column1','column2']]

With Pandas,

wit column names

dataframe[['column1','column2']]

to select by iloc and specific columns with index number:

dataframe.iloc[:,[1,2]]

with loc column names can be used like

dataframe.loc[:,['column1','column2']]
.iloc added
Source Link
Dmitriy
  • 3.5k
  • 8
  • 48
  • 56

With pandas,

wit column names

dataframe[['column1','column2']]

to select by iloc and specific columns with index number:

dataframe.iloc[:,[1,2]]

with loc column names can be used like

dataframe.loc[:,['column1','column2']]

hope it helps !

With pandas,

wit column names

dataframe[['column1','column2']]

to select by iloc and specific columns with index number:

dataframe.iloc[:,[1,2]]

with loc column names can be used like

dataframe.loc[:,['column1','column2']]

hope it helps !

With pandas,

wit column names

dataframe[['column1','column2']]

to select by iloc and specific columns with index number:

dataframe.iloc[:,[1,2]]

with loc column names can be used like

dataframe.loc[:,['column1','column2']]

With pandas,

wit column names

dataframe[['column1','column2']]

withto select by iloc, column and specific columns with index can be used likenumber:

dataframe[dataframe.iloc[:,[1,2]]

with loc column names can be used like

dataframe.loc[:,['column1','column2']]

hope it helps !

edited to fix .loc accessor, the fix for which was < 6 characters

With pandas,

wit column names

dataframe[['column1','column2']]

with iloc, column index can be used like

dataframe[:,[1,2]]

with loc column names can be used like

dataframe.loc[:,['column1','column2']]

hope it helps !

edited to fix .loc accessor, the fix for which was < 6 characters

With pandas,

wit column names

dataframe[['column1','column2']]

to select by iloc and specific columns with index number:

dataframe.iloc[:,[1,2]]

with loc column names can be used like

dataframe.loc[:,['column1','column2']]

hope it helps !

Source Link
Wickkiey
  • 4.7k
  • 2
  • 42
  • 47
Loading