Questions tagged [tabulate]

Count or tally of named items in an object or structure.

Various languages will have different functions for this operation. "table" or "crosstabs" are two such examples. The output may be multi-dimensional.

168 questions
0
votes
2 answers

weighted crosstable in SAS

Let's assume I have the following table: id | var1 | var2 | count 1 | a | b | 3 2 | b | a | 4 3 | c | e | 1 Now I would like to calculate a crosstable: PROC TABULATE; CLASS var1 var2; TABLE var1, var2; RUN; However, my…
D. Studer
  • 1,711
  • 1
  • 16
  • 35
0
votes
1 answer

How to format proc tabulate to produce decimal millions?

My data is in the format of million and I need to tabulate my data as decimal millions in SAS. I have data containing rent in millions of dollars i.e. 1,260,678.21 which I hope to tabulate as decimal millions i.e "1.3". I attempted to create my…
Will.S89
  • 317
  • 5
  • 16
0
votes
1 answer

tabulate showing "\n" while printing

I would like to print a table on the terminal and for that I use the tabulate package but I have extra return chariot '\n'. How can I remove them? import pandas as pd from tabulate import tabulate df = pd.DataFrame({'schools' : ['Harvard', 'MIT',…
Papouche Guinslyzinho
  • 5,277
  • 14
  • 58
  • 101
0
votes
2 answers

XLS Transformation from XML in particular table order

I have the XML file below for which I'm trying to create a XSLT template to tabulate some nodes. May someone could help me out please.
Doc.1 DDFR
Ger Cas
  • 2,188
  • 2
  • 18
  • 45
0
votes
0 answers

Seeking min value - "TypeError: 'numpy.float64' object is not iterable"

Couldn't find an answer in previous questions on the subject. I'm trying to get the minimum value in a column of data, using the following code: import pandas as pd import matplotlib.pyplot as plt import numpy as np from tabulate import tabulate as…
Clauric
  • 1,826
  • 8
  • 29
  • 48
0
votes
2 answers

R - Group by a value and calculate the percentage of the whole group

EDIT: My question was not clear enough. I apologize. The problem was to define groups and assign values of a column of a dataframe to it. I solved the question myself with a chain of ifelse and the comments here. Thanks for that. I then did it…
Canna
  • 113
  • 6
-1
votes
1 answer

R how to create table from dataframe containing counts over groups?

I have a dataframe with the count of for instance males and females for certain groups arranged in this way: df <- data.frame ( Round = c("R1", "R1", "R2", "R2"), N. = c(20, 10, 15,15), Gender = c("M", "F", "M","F")) How can I create a…
ggg
  • 73
  • 1
  • 7
-1
votes
1 answer

How can I wrap a string using python's textwrap library to be exactly a set amount of characters in width?

I have a chunk of text and I want to print it so that every line is exactly n characters in width. I'm using python's textwrap library but the problem I've had with that is that sometimes the line of text will be less than n characters in length…
Jon
  • 5
  • 3
-1
votes
1 answer

double space when exporting to TXT file in python

I have this code that works: print((tabulate(email_list, showindex=False, tablefmt = 'plain')), file=open(output + '\\' + "np.txt", "w")) but when I open the file, the email addresses look like this: b e r o s u n a @ g m a i l . c …
Berny
  • 113
  • 11
-1
votes
1 answer

How to read text file data in scientific format using pandas DataFrame

I have a text file (input.txt) with 2 columns of data which is in scientific format as shown. input.txt file contents: 4.6277245181485196e-02 -3.478992280123e-02 5.147225314664928553e-02 -3.626645537995224627e-02 5.719622597261836416e-02…
user11734037
-1
votes
1 answer

Is there an R function to generate the frequency count in sampling?

This is what I am doing to tabulate the sampling results: > n <- 1000 > tabulate(sample.int(4, n, replace = TRUE)) [1] 238 255 247 260 I will need to do this millions of time with different values of n. I don't care about the actual sequence of…
Dong
  • 481
  • 4
  • 15
-1
votes
2 answers

SAS: Pivot table proc tabulate or proc transpose

My data is currently organized as: NAME COLOR PROFILE HEIGHT K2000 RED C 5.10 K2001 WHITE B 7.11 K2001 BLACK B 5.12 K2001 BLUE B 5.2 K2002 BLUE A 9.3 K2002 RED A 8.2 K2006 …
-1
votes
2 answers

"ALL"-Option for BY (SAS PROC TABULATE)

ODS EXCEL FILE="/mypoath/myfile.xlsx" options( frozen_headers="3" sheet_name="#byval1"); PROC TABULATE data=out; BY byVariable; CLASS varA varB; TABLES varA, varB; RUN; ODS EXCEL CLOSE; The code above creates an excel-file with…
D. Studer
  • 1,711
  • 1
  • 16
  • 35
-1
votes
1 answer

sas proc tabulate (freq)

I have the following question: Some sample data: data; input id article sex count; datalines; 1 139 1 2 2 139 2 2 3 146 2 1 4 146 2 2 5 146 1 0 6 111 2 10 6 111 1 1 ; run; Now, I have this code: proc tabulate; freq count; class article sex; table…
D. Studer
  • 1,711
  • 1
  • 16
  • 35
-1
votes
1 answer

Formatting API List with for loop in a Table

I want to output a list I get from the API in a table so it looks nicer. The data from the API is returned with a for loop. My problem now is that I don't know how to get it that the header isn't looped every time. for Example: And i want one header…
Fabian Breuer
  • 39
  • 1
  • 7
1 2 3
11
12