cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
The .describe() function in Python is really handy for exploratory analysis! Sometimes, you would want to display this as a table on a dashboard, but how? The output is typically printed out as text, not as a dataframe.

Fear not, getting this into a dataframe is fairly painless!

Before we go on, note that using Python requires the Python/R Integration.

Let's say this is the first 10 rows of your SQL output / starting dataframe (the data below is the User IDs and number of gameplays they made for a fictional gaming company)
print(df['gameplay_number'].describe()) gives you the following output
To get this in a table of its own (rather than a printout), use the code below! Note, the key in the dictionary used as an argument for pd.DataFrame is what we want to name the column of summary values in our final output. I chose to name this 'gameplays.'
df2 = pd.DataFrame({'gameplays': df['gameplay_number'].describe()})
df2 = df2.reset_index()

# Use Sisense for Cloud Data Teams to visualize a dataframe by passing the data to periscope.output()
periscope.output(df2)
And there you have it!
Rate this article:
Comments
emmaagro
7 - Data Storage
7 - Data Storage
The describe() method returns description of the data in the DataFrame. If the DataFrame contains numerical data, the description Core Ball contains these information for each column: count - The number of not-empty values. mean - The average (mean) value. Analyzes both numeric and object series, as well as DataFrame column sets of mixed data types. The output will vary depending on what is provided. Refer to the ... The describe() method is used for calculating some statistical data like percentile, mean and std of the numerical values of the Series or DataFrame. It analyzes both numeric and object series and also the DataFrame column sets of mixed data types.
 
 
 
 
Version history
Last update:
‎03-02-2023 09:28 AM
Updated by:
Contributors