Import xplain python package and interact with Object Analytics
How to import the xplain PyPi Package and how to use it to interact with the current Object analytics session.
we need to tell WebAssembly to install the PyPi package xplain, enter xplain
in the input field pip install

Enter following code into code area
'''
This example is based on the Demo instance
https://xoebp.xplain-data.com/objectexplorer/index.html
'''
import xplain
# replace url with your currentObject Analytics host
x=xplain.Xsession(url="https://xoebp.xplain-data.com")
# or if you're running your XOE on your local host,
#just use:
#x=xplain.Xsession()
df = x.open_attribute(object_name="Events",
dimension_name="Activity",
attribute_name="Activity")
Click the run button, a window for count Event grouped by Activity will be opened in Object Analytics screen.

Xsession.open_attribute() is a convenient function for a query to count the Events grouped by Activity, it will create an open query in the xplain session which is shared by current Object Analytics. As result, an attribute Window for Activity will be opened in the Object Analytics Screen.
Last updated