EXPAND ALL
  • Home

DataFrame.drop

Drops the specified columns from the DataFrame.

Returns a DataFrame with the specified columns dropped. Useful for removing columns you don't want to see in the final table result. See keep() on how to specify which columns to keep.

Arguments

NameTypeDescription
columnsUnion[str,List[str]]DataFrame columns to drop, either as a string or a list.

Returns

px.DataFrame: DataFrame with the specified columns removed.

Examples

df = px.DataFrame('process_stats', select=['upid', 'cpu_ktime_ns', 'cpu_utime_ns'])
# Drop upid from df.
df = df.drop('upid')
df = px.DataFrame('process_stats', select=['upid', 'cpu_ktime_ns', 'cpu_utime_ns'])
# Drop upid an cpu_ktime_ns from df.
df = df.drop(['upid', 'cpu_ktime_ns'])

This site uses cookies to provide you with a better user experience. By using Pixie, you consent to our use of cookies.