Relative Content

Tag Archive for pythonpandasdataframe

Trying to exclude blank entries on pandas dataframe.loc command

I have two lists of people in two separate systems. One is our data warehouse, and the other is an autodialer. We recently had an issue where some of the data got duplicated in the dialer. We are trying to identify the problem records and I’m trying to create two lists, one that is a priority list with only active people, and the other is a complete list with everybody. I have two DataFrames that I merged into a single DataFrame and then substituted a blank string for the NaN’s so it’s more readable for the end users. However, now I’m trying to remove the blank records for the “priority” list (the ID gets blanked out as part of the process when the person is made inactive). However when I try it’s not working. Here is what I’ve got:

Convert string of multiple pandas conditions to conditions usable for filtering df

I have an excel-sheet which has a lot of unneccessary information. Therefore I would like to filter out only those rows which contain specific values from a dataframe. However, the dataframe has no column names and I will need to filter the rows with the certain values from multiple dataframes with possibly different amounts of columns.
Therefore I like to filter the rows out based on their values but without knowing the column name.