Explore data
Contents
Explore data#
Once our data is loaded, we can explore what variables it has and the meta data for the variables. We assume that the data has been loaded into a variable called dataset
. For more information on the API endpoints used in these examples, refer to the Python SDK API reference.
variables
- listing available variables by type#
Use the variables method to get a list of variables. It returns a dictionary with the keys keys single
, delimited set
, array
, int
, float
, string
, date
. These all have a list of strings that are the names of variables.
dataset.variables()
meta
- explore answer labels and codes#
Use the meta method to explore answer codes and labels.
dataset.meta(variable='q1')
Other methods to explore data#
Other methods to explore the data include get_variable_text, find, values and other methods in the DataSet class.
dataset.get_variable_text(name='locality')
dataset.find(str_tags=['q2'])
dataset.values(name='locality')
Pandas dataframe#
The data can also be accessed as a pandas dataframe.
df = dataset.get_dataframe()
df.head()