Pewarta Proxy

πŸ“‹ Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

βš™οΈ Pengaturan Proxy Target

Skip to content
AnswerDotAIPublic

Latest commit

Β 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BasedTab

Usage

Installation

Not on PyPI yet. Install:

git clone https://github.com/AnswerDotAI/basedtab.git
pip install -e .

How to use

Load data

read_csv and save_csv

from basedtab.core import BFrame

bf = BFrame.read_csv(path)
bf.head(2).df
<style scoped> .dataframe tbody tr th:only-of-type { vertical-align: middle; } .dataframe tbody tr th { vertical-align: top; } .dataframe thead th { text-align: right; } </style>
Number City Gender Age Income Illness
0 1 Dallas Male 41 40367.0 No
1 2 Dallas Male 54 45084.0 No

Groupby

from basedpl import add, tally, square
MEAN = add.reduce_first / tally
bf.groupby("City", "Income", mean=MEAN)
β”Œβ†’β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
↓"Dallas"⌷         β”‚
↓          Income  β”‚
β”‚mean 45252.23119  β”‚
β”‚                  β”‚
β”‚"New York City"⌷  β”‚
β”‚          Income  β”‚
β”‚mean 96857.13139  β”‚
β”‚                  β”‚
β”‚"Los Angeles"⌷    β”‚
β”‚          Income  β”‚
β”‚mean 95264.15541  β”‚
β”‚                  β”‚
β”‚"Mountain View"⌷  β”‚
β”‚          Income  β”‚
β”‚mean 135078.4158  β”‚
β”‚                  β”‚
β”‚"Boston"⌷         β”‚
β”‚         Income   β”‚
β”‚mean 91554.5715   β”‚
β”‚                  β”‚
β”‚"Washington D.C."βŒ·β”‚
β”‚          Income  β”‚
β”‚mean 70991.61281  β”‚
β”‚                  β”‚
β”‚"San Diego"⌷      β”‚
β”‚          Income  β”‚
β”‚mean 100756.2092  β”‚
β”‚                  β”‚
β”‚"Austin"⌷         β”‚
β”‚          Income  β”‚
β”‚mean 90277.51342  β”‚
β””~β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
RMSE = MEAN.under(square)
bf.groupby("Gender", ["Age", "Income"], mean=MEAN, rmse=RMSE)
β”Œβ†’β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
↓"Male"⌷                     β”‚
↓             Age      Incomeβ”‚
β”‚mean  44.9126253  95670.2472β”‚
β”‚rmse 46.37557969 98752.06754β”‚
β”‚                            β”‚
β”‚"Female"⌷                   β”‚
β”‚             Age      Incomeβ”‚
β”‚mean 44.99776435 85660.92184β”‚
β”‚rmse 46.46704189 89097.22374β”‚
β””~β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Rolling

ts = BFrame(dict(price=[5,4.3,4.1,2,10,20,15,25]))
ts
β”Œβ†’β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ price:β”Œβ†’β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚       β”‚5 4.3 4.1 2 10 20 15 25β”‚ β”‚
β”‚       β””~β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””βˆŠβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
ts.rolling("price", size=3, edge="clamp", mean=MEAN)
β”Œβ†’β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
↓0⌷              β”‚
↓           priceβ”‚
β”‚mean 4.766666667β”‚
β”‚                β”‚
β”‚1⌷              β”‚
β”‚           priceβ”‚
β”‚mean 4.466666667β”‚
β”‚                β”‚
β”‚2⌷              β”‚
β”‚           priceβ”‚
β”‚mean 3.466666667β”‚
β”‚                β”‚
β”‚3⌷              β”‚
β”‚           priceβ”‚
β”‚mean 5.366666667β”‚
β”‚                β”‚
β”‚4⌷              β”‚
β”‚           priceβ”‚
β”‚mean 10.66666667β”‚
β”‚                β”‚
β”‚5⌷              β”‚
β”‚     price      β”‚
β”‚mean    15      β”‚
β”‚                β”‚
β”‚6⌷              β”‚
β”‚     price      β”‚
β”‚mean    20      β”‚
β”‚                β”‚
β”‚7⌷              β”‚
β”‚           priceβ”‚
β”‚mean 21.66666667β”‚
β””~β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
ts.rolling("price", size=2, step=2, mean=MEAN, rmse=RMSE)
β”Œβ†’β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
↓0⌷              β”‚
↓           priceβ”‚
β”‚mean        4.65β”‚
β”‚rmse 4.663153439β”‚
β”‚                β”‚
β”‚1⌷              β”‚
β”‚           priceβ”‚
β”‚mean        3.05β”‚
β”‚rmse 3.225678223β”‚
β”‚                β”‚
β”‚2⌷              β”‚
β”‚          price β”‚
β”‚mean         15 β”‚
β”‚rmse 15.8113883 β”‚
β”‚                β”‚
β”‚3⌷              β”‚
β”‚           priceβ”‚
β”‚mean          20β”‚
β”‚rmse 20.61552813β”‚
β””~β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Plot

ts.plot(title="Time Series")

bf["Income"].hist(title="Income Distribution")

Contributors

Languages