cudf.Series.set_flags#
- Series.set_flags( ) Self[source]#
Return a new object with updated flags.
- Parameters:
- copybool, default False
Specify if a copy of the object should be made. The default value is preserved for compatibility with pandas.
- allows_duplicate_labelsbool, optional
Whether the returned object allows duplicate labels.
- Returns:
- Series or DataFrame
The same type as the caller.
See also
DataFrame.attrsGlobal metadata applying to this dataset.
DataFrame.flagsGlobal flags applying to this object.
Notes
This method returns a new object that’s a view on the same data. The returned object will have
flags.allows_duplicate_labelsset to the value passed. Unlike the pandas version, the default ofcopy=Falsedoes not share memory between the two objects because cudf backs all operations with copy-on-write buffers.Examples
>>> import cudf >>> df = cudf.DataFrame({"A": [1, 2]}) >>> df.flags.allows_duplicate_labels True >>> df2 = df.set_flags(allows_duplicate_labels=False) >>> df2.flags.allows_duplicate_labels False