Drop multiple dates not necessarily a range

Summary

Hi, Sorry for my naivety, I am trying to understand how to drop multiple dates from dataframe through user input.

Steps to reproduce

example code snippet if using only python:

 date_list = datetime(2010, 8, 22),

             datetime(2010, 9, 19),

             datetime(2011, 6, 19),

             datetime(2011, 7, 17),

             datetime(2015, 5, 23),

             datetime(2016, 2, 20)]

df = df.drop(date_list)


Is there a clever way to create such a list in streamlit?

If dropping from a relatively small list or things (dates or otherwise), you could use multi-select.

Otherwise, you could have an “Add date” button or “Number of Dates to Drop” selector to generate a number of date pickers.

I’ve made an example here:

Example hosted here:
https://mathcatsand-examples.streamlit.app/get_date_list

1 Like

Thank you, that’s it!

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