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

Tabulate a variable if label contains a specific word

I have 500 data files and each file has 4000 variables. The name of the variable isn't consistent across each data file. So I want to tabulate the variables that contain the word "hospital" or "medical" in them. I am using Stata for this.
mgdata
  • 57
  • 5
0
votes
0 answers

I am having trouble finding the breakpoint of my code (Tabulate, Python)

For a college assignment, I have been tasked with calculating the genotypes of approximately 200 generations, with the code stopping when BB is greater than .99 . I have checked in with my Professor, who stated that my code looked good but there is…
0
votes
0 answers

Headers are repeated from first line in python table

I dont understand why the headers of my table are repeated on every row rather than just the first row as expected. Also why my print("Closest Approach", min(table)) is also repeated onto every row rather than just singularly printing the minimum…
Orla
  • 23
  • 3
0
votes
0 answers

Python in Terminal, How to show long text in table format in Python?

I use tabulate to show tabled data organize better. It makes life for Terminal junkies easier. I have pandas dataframe with long text in each cell. The problem is tabulate wants to print/show all the text so it does not show the table pretty. is…
0
votes
1 answer

how to print tab separated values of a python list of strings specifying a maximum line length and avoiding string break

I am trying to write a function that takes dir(obj) as argument and prints out a perfect list of string tabbed in multiple columns. dir(obj) is a function that generates a list of strings where each string is a method available for the chosen obj.…
Fernando Soares
  • 140
  • 1
  • 12
0
votes
0 answers

How do you switch the headers to columns using tabulate? instead of the headers in rows i want it in columns

from tabulate import tabulate as t class INFO_SETUP(): def infoSort(self,name): print("Format of table is:","Name","Phone Number","Office Location",sep="\n") global StaffName global StaffPhone global StaffOffice StaffName =…
0
votes
1 answer

How to print list vertical and not horizaontal with tabulate package?

I try to print the results of a list vertical. But they are at the moment display horizontal. So I try it as code: def extract_data_excel_combined(self): dict_fruit = {"Watermeloen": 3588.20, "Appel": 5018.75, "Sinaasappel": 3488.16} …
mightycode Newton
  • 3,229
  • 3
  • 28
  • 54
0
votes
1 answer

Tabulate table is unorganized

Tried a code for having a table in output but the table is not organized enough This is the code that I used for having an output table: import tabulate from tabulate import tabulate data = [[1, 'Zero', "%0.4f" % stdvzero3, "%0.4f" %…
Zahra
  • 1
0
votes
0 answers

How to make to class schedule for a student that takes user input for the time of the class and display output in a table in python

Im sorry but im still new to programming. Im trying to create a schedule for a student that displays two different classes on four different days which are already predetermined but asks the user for the time of the classes which will change the the…
0
votes
1 answer

How to make tabulate package work with PySimpleGUI? Output is not aligned correctly

I am trying to use tabulate in order to produce a nice table output. It works fine when using print, but when I update a Text-element with the exact same string, it's not vertically aligned. I get this ugly result in PySimpleGUI: Innskudd/uttak …
0
votes
1 answer

csv package parses each char as a row

According to this answer it seems I can parse each row of a CSV file with csv.reader(data, delimiter=",", quotechar='"'), so I made the following MWE (Minimal Working Example): #!/usr/bin/env python3 # -*- coding: utf-8 -*- import csv data =…
fauve
  • 226
  • 1
  • 10
0
votes
1 answer

Print a table on a file with tabulate printing one row at a time only having headers for the first row printed

I am trying to use tabulate to print rows of a pandas DataFrame one at a time on a file. Only the first printing needs the headers, the other rows printed need the same spacing as the first row but no headers printed. Is this achievable with simple…
Ernek
  • 3
  • 5
0
votes
1 answer

Python convert array of objects with k, v pairs into table

I'm looking for way to convert the beneath list of dicts into a table. From: arr = [{'G': ["Apple", "Banana"]}, {'M': ["Orange", "Kiwi"]}, {'P': ["Orange"]}, {'MP': ["All"]}] To: User Fruit G Apple, Banana M Orange,…
geojoe
  • 329
  • 1
  • 3
  • 12
0
votes
2 answers

tabulate counts of all values from all keys in list of dicts

I have a list like this: [{'migs_ba': 'O', 'migs_eu': 'O', 'migs_org': 'O', 'migs_pl': 'O', 'migs_vi': 'O', 'mimag': 'EM', 'mimarks_c': 'O', 'mimarks_s': 'EM', 'mims': 'EM', 'misag': 'EM', 'miuvig': 'EM'}, {'migs_ba': 'O', …
Mark Miller
  • 3,011
  • 1
  • 14
  • 34
0
votes
1 answer

Code block format breaks when sending more data row via (tabulate) - Python to slack

When I run the following python script, instead of sending one message it sends in multiples and breaks the code block format as well as the tabulate/beautify/table format of the data. Maybe I'm not searching for the correct term to describe this…