The most advanced ML Observability platform
We’re super excited to share that Aporia is now the first ML observability offering integration to the Databricks Lakehouse Platform. This partnership means that you can now effortlessly automate your data pipelines, monitor, visualize, and explain your ML models in production. Aporia and Databricks: A Match Made in Data Heaven One key benefit of this […]
Start integrating our products and tools.
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.