Periscope
Please enable JavaScript to continue!
Sign Up
Login
Community
Home
Ask, Share and Learn
Add new
R and Python Code Examples
Helpful R and Python examples that can be easily re-used.
Filter
Newest
Active
Popular
Most likes
Most replies
Most views
Tags
Clear filter
Follow
Visualizing Statistical Significance in Samples over Time - Python
Let's say you're tracking a KPI, and want to see if any changes in your KPI are statistically significant. It would be nice to mark these points on your line graph to call attention to these…
Neha Kumar
Solutions Engineer
Neha_Kumar
2 wk ago
63
1
R and Python Code Examples
Radial Bar Chart with Pending Pipeline
Radial bar charts are a great way to visualize progress charts - but sometimes it's helpful to be able to visualize that progress with the additional context of more pipeline as well.…
Christine Quan
moderator
Christine_Quan
1 mth ago
72
2
R and Python Code Examples
Creating a split funnel chart in R
Funnel charts are a common way to visualize conversion for various stages in a business process. Sometimes, it could be interesting to visualize a funnel split by demographic - I recommend just…
Christine Quan
moderator
Christine_Quan
1 mth ago
68
2
R and Python Code Examples
Your Guide to Multivariate Linear Regressions in R
Once you’ve gotten familiar with bivariate linear regressions (one explanatory variable, and one response variable), you may want to delve into seeing how multiple explanatory variables contribute…
Neha Kumar
Solutions Engineer
Neha_Kumar
12 days ago
96
1
R and Python Code Examples
Confidence Interval Printout - R
Let's say we want a printout of our confidence interval for an entire sample (Note, if you're looking for a visual of a confidence interval over time, check out the post here !…
Neha Kumar
Solutions Engineer
Neha_Kumar
1 mth ago
87
R and Python Code Examples
Text Pivots - Pandas
****The code for this solution is leveraged from this source *** Let's say you want to pivot a table, but you want the actual data in the pivoted cells to be a string.…
Neha Kumar
Solutions Engineer
Neha_Kumar
1 mth ago
94
1
R and Python Code Examples
Using Python to Plot only the Rolling Average Line
Want to show a rolling average to your data? Using the Periscope Data Python / R integration , we can accomplish this with a single line of Python code.…
Neha Kumar
Solutions Engineer
Neha_Kumar
2 mths ago
135
R and Python Code Examples
Using R to Plot only the Rolling Average Line
Want to show a rolling average to your data? Using the Periscope Data Python / R integration , we can use a few quick lines in R to accomplish this. Here are the first few rows of our SQL output - a…
Neha Kumar
Solutions Engineer
Neha_Kumar
2 mths ago
93
R and Python Code Examples
Transposing Tables in R
Transposing a dataframe in R is as simple as 2 quick lines of code. The first is to actually transpose the table, and the second is to name your column headers.…
Neha Kumar
Solutions Engineer
Neha_Kumar
2 mths ago
67
R and Python Code Examples
Pivoting large data sets with dynamic column names
I frequently get requests that require me to reshape summary data so that months are presented as columns. In most cases, I also I need the dates/months included to be dynamic,…
Safiya Moran
Data Scientist, Litmus
Safiya_Moran.1
2 mths ago
107
3
R and Python Code Examples
Confidence Interval Printout - Python
Let's say we want a printout of our confidence interval for an entire sample (Note, if you're looking for a visual of a confidence interval over time, check out the post here !…
Neha Kumar
Solutions Engineer
Neha_Kumar
1 mth ago
263
1
R and Python Code Examples
Test for Normal Distribution of Data with Python
One of the first steps in exploratory data analysis is to identify the characteristics of the data, importantly including a test for distribution patterns.…
Ray Harris
moderator
Ray_Harris
2 mths ago
463
2
R and Python Code Examples
Visualizing Statistical Significance in Samples over Time - R
Let's say you're tracking a KPI, and want to see if any changes in your KPI are statistically significant. It would be nice to mark these points on your line graph to call attention to these…
Neha Kumar
Solutions Engineer
Neha_Kumar
2 wk ago
125
R and Python Code Examples
Compounding Values with Dynamic Multipliers
Coming from the world of spreadsheets, you may have defined a set of values recursively with ease, referencing the previous value plus another variable to calculate a new value.…
Ray Harris
moderator
Ray_Harris
3 mths ago
89
1
R and Python Code Examples
Showing a Confidence Interval - R and Periscope Visualization
Confidence intervals are a favorite among many professionals with a statistics background. We can use the R integration in Periscope to show the Confidence interval as a shaded region around a line…
Neha Kumar
Solutions Engineer
Neha_Kumar
2 mths ago
189
R and Python Code Examples
cohort analysis grid visualization with Python, Pandas, matplotlib and Seaborn
I want to share some code I put together to make a cohort grid using Python, Pandas, matplotlib and Seaborn in case it's useful to others. # SQL output is imported as a pandas dataframe variable…
Chris Eldredge
Chris_Eldredge
3 mths ago
2
replies
508
7
Chris Eldredge
3 mths ago
R and Python Code Examples
Getting Around Overlapping Data Labels With Python
A common hazard when adding data labels to a chart, is that often times the data labels will overlap when there are two points located relatively close to one another.…
Adam Luba
moderator
Solutions Engineer
Adam_David
3 mths ago
1045
1
R and Python Code Examples
Percentile Curves - Another way to show distributions
Note: This solution requires Periscope's Python/R integration Let's say you have data set that is heavily skewed, like this hypothetical data set here plotting the amount users paid on a fictional…
Neha Kumar
Solutions Engineer
Neha_Kumar
4 mths ago
933
2
R and Python Code Examples
Calculating Trimmed Means (SQL and Python Variations)
Data can oftentimes have extreme outliers, which can heavily skew certain metrics, such as the mean. One way to get around this is to using a trimmed mean.…
Neha Kumar
Solutions Engineer
Neha_Kumar
4 mths ago
1
reply
1070
2
Rajat Mittal
9 days ago
R and Python Code Examples
Embed URL Generation Made Easy With Python Script
Creating an embed URL is a multistep process that can easily be botched along the way. Finding where the mistake was made can be tricky, and the generation of multiple embed URLs can be a painful…
Adam Luba
moderator
Solutions Engineer
Adam_David
4 mths ago
1
reply
1150
3
Ray Harris
moderator
4 mths ago
R and Python Code Examples
Plotting a Gradient Line in R
Color is an extremely useful visualization tool. On a line chart, a color gradient can be used to emphasize the highs and lows. Using the Python / R integration in Periscope,…
Neha Kumar
Solutions Engineer
Neha_Kumar
5 mths ago
263
1
R and Python Code Examples
A Beginner's Guide to Linear Regression Models in Python
Does your team prefer Python over R? Or are you looking to brush up your on your Python skills? We'll walk through a simple example of a linear regression model using the scikit-learn library in…
Neha Kumar
Solutions Engineer
Neha_Kumar
1 mth ago
765
6
R and Python Code Examples
A Beginner's Guide to Linear Regression Models in R
New to R? Not a problem! You can still deliver valuable insights to your team using a few simple functions. This article walks through how you can use Periscope's Python and R integration along with…
Neha Kumar
Solutions Engineer
Neha_Kumar
1 mth ago
1
reply
665
4
Ranjeet Tate
1 mth ago
R and Python Code Examples
Python Using and Example with Periscope
Dear All, Periscope has the great environment to test and play with data using SQL. In some cumbersome cases, we need python to analyze the data we need.…
steven Duong
steven_Duong
5 mths ago
1
reply
226
Neha Kumar
5 mths ago
R and Python Code Examples
Sorting Stacked Proportional Bar Charts by Magnitude
By default in many charting libraries and tools, series within stack bars are arranged in the same order. Looking at the image below, blue is above orange, which is above green,…
Neha Kumar
Solutions Engineer
Neha_Kumar
5 mths ago
530
1
R and Python Code Examples
1
2
Next
Add article
Helpful R and Python examples that can be easily re-used.
Create a Post
Categories
Announcements and Events
Announcements
Events
Ask, Share and Learn
Ask a Question!
R and Python Code Examples
SQL Code Examples
Datasets
Learn SQL!
Competition Submissions
SQL Interview Questions
Questions
Answer Keys
Discussion Forums
For Data Managers
Product Talk
Data Engineering
Analytics Discussions
Off Topic
Top contributors
View all members
Recent activity
Home
Announcements and Events
Announcements
Events
Ask, Share and Learn
Ask a Question!
R and Python Code Examples
SQL Code Examples
Datasets
Learn SQL!
Competition Submissions
SQL Interview Questions
Questions
Answer Keys
Discussion Forums
For Data Managers
Product Talk
Data Engineering
Analytics Discussions
Off Topic