Do not use list
in cell, it creates a lot of problem for pandas
. If you do need an object
column, using tuple
:
df.A.map(tuple).isin([(1,2)])
Out[293]:
0 True
1 False
2 False
Name: A, dtype: bool
#df[df.A.map(tuple).isin([(1,2)])]
More Related Contents:
- How can I obtain the element-wise logical NOT of a pandas Series?
- Pandas – Slice large dataframe into chunks
- Pandas convert a column of list to dummies
- Python pandas slice dataframe by multiple index ranges
- Python – rolling functions for GroupBy object
- Prevent pandas from interpreting ‘NA’ as NaN in a string
- Key error when selecting columns in pandas dataframe after read_csv
- Missing data, insert rows in Pandas and fill with NAN
- pandas left join and update existing column
- pandas read_html ValueError: No tables found
- pandas to_html using the .style options or custom CSS?
- how to read certain columns from Excel using Pandas – Python
- Resample Daily Data to Monthly with Pandas (date formatting)
- Saving plots (AxesSubPlot) generated from python pandas with matplotlib’s savefig
- Return multiple columns from pandas apply()
- Set order of columns in pandas dataframe
- ImportError: No module named pandas
- Read specific columns with pandas or other python module
- How to slice a pandas DataFrame by position?
- How to merge csv files with different headers but same data on condition
- Merging two dataframes based on a date between two other dates without a common column
- Filling in date gaps in MultiIndex Pandas Dataframe
- Pandas rolling values
- I want to multiply two columns in a pandas DataFrame and add the result into a new column
- Find unique values in a Pandas dataframe, irrespective of row or column location
- Using pandas crosstab to create a bar plot
- Change the facecolor of boxplot in pandas
- Can you format pandas integers for display, like `pd.options.display.float_format` for floats?
- computing the mean for python datetime
- Pandas explode multiple columns [duplicate]