Create a dataframe from a dataframe by not extracting certain columns

97 views Asked by At

Create a dataframe from a dataframe by not extracting certain columns.

For example: In dataframe 1, we have 100 columns. We can create another dataframe taking 90 columns, and we can do it by:

new_df = pd.DataFrame(df, columns = []) # where columns = [] includes the 90 desired columns.

But is there a way to do the above not by writing 90 columns, can't we do columns != [] --> By passing the 10 columns which we don't need.

0

There are 0 answers