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
1
vote
1 answer

How to use tabulate library?

I am trying to use tabulate with the zip_longest function. So I have it like this: from __future__ import print_function from tabulate import tabulate from itertools import zip_longest import itertools import locale import operator import re 50…
mightycode Newton
  • 3,229
  • 3
  • 28
  • 54
1
vote
1 answer

How to make link in python Tabulate? see my following code

I have this code Where I want to hyperlink urlvalue to the title I tried to insert HTML hyperlink but got exception error... But I like to get hyperlink in the table with two values like Title will be clickable with url value
Amit
  • 11
  • 2
1
vote
1 answer

Tabulate the columns of a matrix in R

I have this piece of code that calculates the vector "week1" (predefined in the exercise), based on the number of times a value is repeated in that column. I would need to create a function that does the same for the other 6 columns (from 2 to 7),…
1
vote
0 answers

read CSV (actually semicolon) as Dataframe in PyCharm

I have done this kind of things in JupyterNotebooks and Sypder IDE, however, when i try to read a print a csv file in Pycharm, it shows the data with the separator, not tabulated as I wish. I have tried the following: import pandas as…
1
vote
2 answers

Creating a matrix for the following vector in R

A vector contains the following numerical data after prime factorization of a certain number x: c <- c(2,2,2,3) This is the prime factorization of 24 The first column of the matrix should contain the prime factors 2 and 3 The second column should…
Mike
  • 13
  • 2
1
vote
1 answer

Python - using tabular for a dictionary that's 3 levels deep

Is it possible to use the tabulate function with a dictionary that is three levels deep? I took this dictionary from source and modified it a bit just to use as an idea. MENU = { "espresso": { "ingredients 1": { …
sabuu26
  • 11
  • 1
1
vote
1 answer

Separate csv data from single column to multiple columns

I am pretty new to python and tried searching many forums but didn't get the answer. I have a table created with tabulate and written in csv file. But I am getting data in single column, which I would like to get in multiple columns. [Sample data…
Omkar S
  • 15
  • 3
1
vote
1 answer

How to print table in looping pyhton console

I want to print a table on my console. From now am using pandas how to print using tabulate Here is my Source code: from numpy import average import pandas as pd z = 10119011 a = 17 c = 43 m = 499 for i in range(0, 21): LCG = ((a*z)+c) % m …
1
vote
3 answers

Create cross-tabulation of most frequent value of string variable and sort by frequency

I have a sample dataset: df <- data.frame(category = c("A", "A", "B", "C", "C", "D", "E", "C", "E", "A", "B", "C", "B", "B", "B", "D", "D", "D", "D", "B"), year = c(1, 2, 1, 2, 3, 2, 3, 1, 3, 2, 1, 1, 2, 1, 2, 3, 1, 2, 3, 1)) and would like to…
Anton
  • 254
  • 1
  • 9
1
vote
1 answer

Python Tabulate a dictionary without raw data

I am trying to print a table of values of a function. If X is 1 then Y would be something like 4, so in a Column all X values and in Y all the solutions. For this. I am using an eval that solves the string equation, the program asks for number of…
Felix Caba
  • 13
  • 3
1
vote
1 answer

Reformat output of R table() command for plotting

I wish to plot some count data (likely as a bubble plot). I've some different experiments and for each experiment, I've three replicates. The output from the table() command is given below. > with(myData.df, table(ChargeGroup,Expt,Repx)) , , Repx =…
The August
  • 469
  • 2
  • 7
  • 18
1
vote
1 answer

Adding a new column to the table in Python

I want to make a table that summarizes the result of my grid search. I wrote the code below. To show just different configurations, the table works fine. But I want to add a new column that shows the loss for each configuration too. I don't know how…
Totoro
  • 474
  • 2
  • 6
  • 18
1
vote
1 answer

Tabulating data coming from a DB query

I feel I'm either not searching for the correct terms or I'm not fully understanding the difference in how data is 'constructed' in Python compared to say, SAS or SQL. I've connected PyCharm Pro to an Impala database. I'm able to query a table and…
Dan
  • 97
  • 1
  • 7
1
vote
1 answer

How to send tabular list content in an email body python

I have a list which is a combination of splitted dataframe as below and I am trying to send teh content of it in an email body using email.message package. The string variable in the picture is what is passed to msg.set_content(text)…
simi
  • 53
  • 2
  • 9
1
vote
0 answers

Python - Tabulate - Comments in between rows

I'm using Tabulate in order to print data in a table format. I'm trying to figure out whether I could somehow add comments in between rows without any impact on the alignment. That's how it is: 1. ItemA A: 0 B: 4 C: 8 D: 8 E: 0 2.…
Nick M
  • 69
  • 7
1 2
3
11 12