Visualising your data

Viewing your data

The print function will just show your data, use the built in method .display() to see them together

# first load your data and create a behavpy instance of it

df.display()
Example output from .display()

Summary statistics

You can also get quick summary statistics of your dataset with .summary()

df.summary()

# an example output of df.summary()
output:
behavpy table with:
    individuals       675
   metavariable         9
      variables        13
   measurements   3370075
 
# add the argument detailed = True to get information per fly
df.summary(detailed = True)

output:
                               data_points          time_range
id
2019-08-02_14-21-23_021d6b|01         5756   86400  ->  431940
2019-08-02_14-21-23_021d6b|02         5481   86400  ->  431940

Be careful with the pandas method .groupby(). This will return a pandas object back and not a behavpy object. Most other common pandas actions will return a behavpy object.

Visualising your data

Whilst summary statistics are good for a basic overview, visualising the variable of interest over time is usually a lot more informative.

Heatmaps

The first port of call when looking at time series data is to create a heatmap to see if there are any obvious irregularities in your experiments.

# Enter the column name of any variable in the data table
# the default variable argument is 'moving' but can be used for any numerical or boolean variable from the data 

df.heatmap(variable = 'moving')
output plot for the .heatmap() function for the movement variable in Drosophila

Last updated