I would like to know how to select a specific column with its number but not with its name in a dataframe ?
Like this in Pandas:
df = df.iloc[:,2] >
Same solution as mirkhosro:
For a dataframe df, you can select the column n using df[n], where n is the index of the column.
df[n]
Example:
df = df.filter(df[3]!=0)
will remove the rows of df, where the value in the fourth column is 0.
Note that you can check the columns using df.printSchema()
df.printSchema()