How to make a static column?

Summary

I want to create one column in my dataframe thatโ€™s always the same. Row 1 will always be 1, row 2 will be 2 and so on. Is there a way to do this where those column values will remain the same, even if a user sorts a different column?

Hi @nzylakffa

It is possible to implement that by segmenting your data into 2 parts:

  1. Static part that will remain the same no matter what filter was applied
  2. Dynamic part that will change as user filters the data

Perform the above user filter and in the last step, use pd.concat to combine the above 2 DataFrames together for a final display.

Hope this helps!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.