Memo to ask for KPI with python

Overall sales / number of users

per_day   = dict()  #Make a dict from initialization
user = [] #Make an array from.
for payment_log in PaymentLog.all()[:SAMPLING_NUM]:#Repeat 10 times.
    payment_log = filter_values_for_print(payment_log)
    price= payment_log['price']
    per_day["price"] = per_day.get("price", 0) + price #Add more and more price to the initial value of price.=
    print per_day["price"] #The total sales are displayed
    user_id = payment_log['user_id']
    user += [user_id] #If you can't put parentheses, the display will be disjointed.
    print per_day["price"] /len(user)

Recommended Posts

Memo to ask for KPI with python
Convert memo at once with Python 2to3
Memo # 4 for Python beginners to read "Detailed Python Grammar"
Memo # 3 for Python beginners to read "Detailed Python Grammar"
Memo # 1 for Python beginners to read "Detailed Python Grammar"
Memo # 2 for Python beginners to read "Detailed Python Grammar"
Memo # 7 for Python beginners to read "Detailed Python Grammar"
Memo # 6 for Python beginners to read "Detailed Python Grammar"
Memo for editing scenes with Blender python (W.I.P.)
Memo # 5 for Python beginners to read "Detailed Python Grammar"
Connect to BigQuery with Python
Python memo (for myself): Array
Memo to create your own Box with Pepper's Python
A memo connected to HiveServer2 of EMR with python
Twitter graphing memo with Python
Connect to Wikipedia with Python
Post to slack with Python 3
Introduction to Mathematics Starting with Python Study Memo Vol.1
Python code memo for yourself
[Python] A memo to write CSV vertically with Pandas
Switch python to 2.7 with alternatives
Write to csv with Python
For those who want to write Python with vim
~ Tips for beginners to Python ③ ~
Introduction to Python For, While
Update Python for Raspberry Pi to 3.7 or later with pyenv
Try to display various information useful for debugging with python
Experiment to make a self-catering PDF for Kindle with Python
Introduction to Python for VBA users-Calling Python from Excel with xlwings-
Problem study memo to ask for too much divided by 1000000007
Link to get started with python
[Python] Write to csv file with Python
Create folders from '01' to '12' with python
Nice to meet you with python
[Memo] Links for developing with Flask
Try to operate Facebook with Python
python memo --Specify options with getopt
Output to csv file with Python
Input / output with Python (Python learning memo ⑤)
Getting Started with Python for PHPer-Classes
Convert list to DataFrame with python
MP3 to WAV conversion with Python
To do tail recursion with Python2
How to get started with Python
What to do with PYTHON release?
Unable to install Python with pyenv
How to use FTP with Python
How to calculate date with python
Easily post to twitter with Python 3
[Nanonets] How to post Memo [Python]
I want to debug with Python
An introduction to Python for non-engineers
Getting Started with Python for PHPer-Functions
"Scraping & machine learning with Python" Learning memo
[Memo] Tweet on twitter with python
Python memo
Python learning memo for machine learning by Chainer Chapter 8 Introduction to Numpy
python memo
Python learning memo for machine learning by Chainer Chapter 10 Introduction to Cupy
[Python] A memo that I tried to get started with asyncio
Python memo