Everything you need for AI Performance in one platform.
We decided that Docs should have prime location.
Fundamentals of ML observability
Metrics, feature importance and more
We’re excited ???? to share that Forbes has named Aporia a Next Billion-Dollar Company. This recognition comes on the heels of our recent $25 million Series A funding and is a huge testament that Aporia’s mission and the need for trust in AI are more relevant than ever. We are very proud to be listed […]
Consider a DataFrame with a lot of columns and we need all of them except for one. In this short how-to article, we will learn a convenient way of selecting all columns except for one.
The loc method is used for selecting rows and columns by their labels. We will write a condition in the loc method using the columns method and the name of the unwanted column.
df.loc[:, df.columns != "f3"]
We can use a list comprehension in the select function to create a list of the desired columns.
df.select([col for col in df.columns if col != "f2"])
The expression inside the select function is a list comprehension that creates a list with all the column names if it is not “f2”.
It is important to note that another way of solving this task is to drop the undesired column. Both Pandas and PySpark have a drop function to do this operation.