Reputation: 13
Im looking how can I use the information (in this case date) that is entered in Jupyter Widgets-Date picker. My code below creates a widget where I can select the date.
import ipywidgets as widgets
w=widgets.DatePicker(
description='Pick a Date',
disabled=False
)
w
How can I use the date that is selected in the widget?
Upvotes: 0
Views: 4566
Reputation: 137
For pyspark it could be something like
import ipywidgets as widgets
w = widgets.DatePicker(
description='Pick a Date',
disabled=False
)
w
Then you access it like:
w.value
table = spark.read.parquet("path")
table.filter(F.col(your_date_column)==w.value).show()
Check the image below for how the output looks like:
Upvotes: 2
Reputation: 5565
As with all widgets, you can access the chosen value using w.value
.
The ipywidgets tutorial can take you through some basic concepts: https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Basics.html
Upvotes: 0