-
Notifications
You must be signed in to change notification settings - Fork 50
Exploring data
Douglas Blank edited this page Mar 14, 2023
·
3 revisions
Before heading into DataGrid's UI, it might be useful to explore DataGrid's methods interactively for exploring data.
See the first and last few rows of a DataGrid:
dg
See the first few rows of a DataGrid:
dg.head()
See the last few rows of a DataGrid:
dg.tail()
dg.info()
You can iterate over all of the data as lists:
for row in dg:
print(row)
You can also iterate over all of the data as dicts:
for row in dg.to_dicts():
print(row)
for row in dg.to_dicts(columns="Column 1"):
print(row)
for row in dg.to_dicts(columns=["Column 1", "Column 2"]):
print(row)
Of course, one can iterate over the DataGrid row by row. But you can also query the underlying database using the same syntax used in the UI filters.
data = dg.select("{'score'} < -0.5")
Or directly into a Pandas DataFrame:
df = dg.select_dataframe("{'score'} < -0.5")
For more information on filter syntax, see: https://github.com/comet-ml/kangas/wiki/Filter-Expressions
For more information:
Kangas DataGrid is completely open source; sponsored by Comet ML
-
Home
- User Guides
- Installation - installing kangas
- Reading data - importing data
- Constructing DataGrids - building from scratch
- Exploring data - exploration and analysis
- Examples - scripts and notebooks
- Kangas Command-Line Interface
- Kangas Python API
- Integrations - with Hugging Face and Comet
- User Interface
- FAQ - Frequently Asked Questions
- Under the Hood
- Security - issues related to security
- Development - setting up a development environment
- Roadmap - plans and known issues
- User Guides