'How to select columns from a different places of a large data frame [duplicate]

Hi I have a pandas data frame with about 85 columns . I want to create a data frame using 2nd column and 30-45 columns. I tried with .iloc but gives me a error. Your advice much appreciated

df.iloc[:,(2,[30:45])]


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source