analytics

Percentage calculation in pivot table pandas with columns

被刻印的时光 ゝ 提交于 2019-12-04 15:34:22
I have a dataset containing several sells register from different vendors, locations, dates, and products. The data set is like this: local categoria fabricante tipo consistencia peso pacote ordem vendas_kg AREA I SABAO ASATP DILUIDO LIQUIDO 1501 A 2000g PLASTICO 1 10 AREA I SABAO TEPOS DILUIDO LIQUIDO 1501 A 2000g PLASTICO 1 20 AREA I SABAO ASATP CAPSULA LIQUIDO 1501 A 2000g PLASTICO 1 20 AREA I SABAO TEPOS CAPSULA LIQUIDO 1501 A 2000g PLASTICO 1 30 AREA I SABAO ASATP DILUIDO LIQUIDO 1501 A 2000g PLASTICO 2 20 AREA I SABAO TEPOS DILUIDO LIQUIDO 1501 A 2000g PLASTICO 2 30 AREA I SABAO ASATP

How to track user usage on site?

[亡魂溺海] 提交于 2019-12-04 14:16:25
I am using PHP/MYSQL. Each time a user logs in we insert the time they logged in and the date they logged in. While its easy for us to tell how many users logged in a particular day i am not sure how to calculate how much time they spent on the site. For instance, just like a user signs in and we insert record into login_tracking table we also update that record when the user hits "logout" with the time they logged out. That way we subtract the time logged in and logged out and we get each persons time spent, but what happens if majority of people don't hit "logout" and instead clear cookies

Good open source analytics/stats software in PHP? [closed]

拜拜、爱过 提交于 2019-12-04 14:14:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . The url shortening service I'm building needs to display some basic click stats to users: # of clicks, conversions, referring domains, and country (filterable by a date range). I'll possibly want more advanced stats in the future. Is there existing open source software that will allow me to pass events to it and

Mobile analytics for android library [closed]

一世执手 提交于 2019-12-04 13:34:42
Closed . This question is opinion-based. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it can be answered with facts and citations by editing this post . Closed 5 years ago . I am working on android library and wondering which analytics solution would be the best for this purpose. I want to monitor: unique app installations / removals using my library memory consumption, number of background applications while doing some specific operations in my library crashes / exceptions custom events All these statistics should be easily grouped

Catching UTM Params in Rails

∥☆過路亽.° 提交于 2019-12-04 12:49:59
I am trying to catch the UTM Params in the URL to add Source, Campaign etc to a User Account. Sadly, I can't seem to figure out how to catch those params. As of know I following the Blog Article http://www.matthuggins.com/articles/tracking-new-user-registrations-by-source-search-terms So, in my Application Controller I have following: ApplicationController.class_eval do before_filter :capture_referrer protected def capture_referrer session[:referrer] = request.env['HTTP_REFERER'] if !session[:referrer] end end In the create Action in the user controller @user.referrer = session[:referrer] and

Exactly replicating R text preprocessing in python

泪湿孤枕 提交于 2019-12-04 09:41:14
问题 I would like to preprocess a corpus of documents using Python in the same way that I can in R. For example, given an initial corpus, corpus , I would like to end up with a preprocessed corpus that corresponds to the one produced using the following R code: library(tm) library(SnowballC) corpus = tm_map(corpus, tolower) corpus = tm_map(corpus, removePunctuation) corpus = tm_map(corpus, removeWords, c("myword", stopwords("english"))) corpus = tm_map(corpus, stemDocument) Is there a simple or

Track Page Views using PHP

爷,独闯天下 提交于 2019-12-04 09:08:23
I'm looking for a way to track the number of visits to a page, without counting duplicates (like someone hitting refresh several times) and I'd like to figure out the best way to do it without keeping track of every single IP address to view the page. Perhaps a cookie? Any other suggestions? Either use Webalizer to analyse your logfiles or use Google Analytics to track those metrics for you or - if you are looking for an extendable and self hosted solution, try Piwik : Piwik is a downloadable, open source (GPL licensed) real time web analytics software program. It provides you with detailed

Simple NGINX log file analyzer [closed]

谁说我不能喝 提交于 2019-12-04 07:32:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm looking for a simple tool to analyze my NGINX logs on my macbook. I want to be able to get some basic stats including bot access and also be able to sort/filter the logs to find out what happened right before the server crashed. 回答1: You may try with GoAccess; free and open source console based. It may

jQuery.on('click') before jQuery.click?

◇◆丶佛笑我妖孽 提交于 2019-12-04 06:32:58
I have an external script, wich i can't modify. This script load a button, and add a jQuery .click on it... and it finish with "return false". I need to trigger my own code on this click. When i load the page the doesn't exists, so i need to use .on('click') to bind "live". But it looks like the .on('click') is loaded "after" the .click and as he use "return false", my .on('click') is not loaded. So the question is... How can i trigger my on click on this dynamically loaded a#btn wich already has a .click function returning false ? Here is the fiddle : http://jsfiddle.net/PLpqU/ And here a

Spotfire date difference using over function

删除回忆录丶 提交于 2019-12-04 05:14:48
问题 I have the following data set: Item || Date || Client ID || Date difference A || 12/12/2014 || 102 || A || 13/12/2014 || 102 || 1 B || 12/12/2014 || 141 || B || 17/12/2014 || 141 || 5 I would like to calculate the difference in years between the two dates when the client ID is the same. What expression can I use in a calculated column to get that value? UPDATE Hi This would be the intended values calculated. My table has approximately 300,000 records in no particular order. Would I have to