You need add copy
:
df = data.loc[data.ID == 79]
to:
df = data.loc[data.ID == 79].copy()
If you modify values in df
later you will find that the modifications do not propagate back to the original data (data
), and that Pandas does warning.
More Related Contents:
- Why does concatenation of DataFrames get exponentially slower?
- Comparing two dataframes and getting the differences [duplicate]
- Pandas: How to easily share a sample dataframe using df.to_dict()?
- Pandas/Python: Set value of one column based on value in another column
- Pandas: Get Dummies
- Get the name of a pandas DataFrame
- how to get ticks every hour?
- Calculate weighted average using a pandas/dataframe
- Comparing previous row values in Pandas DataFrame
- What is the difference between join and merge in Pandas?
- Ambiguity in Pandas Dataframe / Numpy Array “axis” definition
- Counting unique values in a column in pandas dataframe like in Qlik?
- Pandas SettingWithCopyWarning [duplicate]
- flattening nested Json in pandas data frame
- Count distinct words from a Pandas Data Frame
- Pandas – dataframe groupby – how to get sum of multiple columns
- Python pandas / matplotlib annotating labels above bar chart columns [duplicate]
- How to upsert pandas DataFrame to PostgreSQL table?
- How to plot multiple dataframes to the same plot axes
- python pandas read_csv delimiter in column data
- Pandas Plotting Display all date values on x-axis (matplolib only displays few values) formatted as MMM-YYYY [duplicate]
- Week of a month pandas
- Numpy isnan() fails on an array of floats (from pandas dataframe apply)
- Add a sequence number to each element in a group using python
- Add column of empty lists to DataFrame
- Normalize DataFrame by group
- Color a scatter plot by Column Values
- pandas extract year from datetime: df[‘year’] = df[‘date’].year is not working
- pandas.read_csv FileNotFoundError: File b’\xe2\x80\xaa’ despite correct path
- Pandas: Selecting rows based on value counts of a particular column