output-formatting Questions
6
Solved
I am writing a script and I want to output text messages to the console with different colors depending on conditions. For example: RED for errors and BLUE for warnings, etc.
I am using RStudio.
Sometimes asked 29/5, 2012 at 16:8
7
Solved
For example, I want to count from 001 to 100. Meaning the zero buffer would start off with 2, 1, then eventually 0 when it reaches 100 or more.
ex:
001
002
...
010
011
...
098
099
100
I could do ...
Opus asked 7/7, 2010 at 0:9
23
Solved
When I print a numpy array, I get a truncated representation, but I want the full array.
>>> numpy.arange(10000)
array([ 0, 1, 2, ..., 9997, 9998, 9999])
>>> numpy.arange(10000)....
Harpy asked 1/1, 2010 at 1:51
6
Solved
kubectl get command has this flag -o to format the output.
Is there a similar way to format the output of the kubectl describe command?
For example:
kubectl describe -o="jsonpath={...}" pods my-...
Serpentiform asked 26/5, 2016 at 14:59
10
Solved
I am creating a dataframe using this code:
df <- data.frame(dbGetQuery(con, paste('select * from test')))
Which results in this:
UID BuildingCode AccessTime
1 123456 BUILD-1 2014-06-16 07:0...
Reagan asked 26/6, 2014 at 10:24
17
Solved
I am using spark-csv to load data into a DataFrame. I want to do a simple query and display the content:
val df = sqlContext.read.format("com.databricks.spark.csv").option("header", "true").load("...
Rutkowski asked 16/11, 2015 at 19:17
4
Solved
There is an option in R to get control over digit display. For example:
options(digits=10)
is supposed to give the calculation results in 10 digits till the end of R session. In the help file of...
Maupassant asked 18/2, 2010 at 9:48
8
I have some code which will read two strings from the user:
name1 = input("Enter name 1: ")
name2 = input("Enter name 2: ")
Later, I want to format those strings into a longer ...
Leucocratic asked 5/8, 2013 at 8:15
8
Solved
I am using PostgreSQL 8.4 on Ubuntu. I have a table with columns c1 through cN. The columns are wide enough that selecting all columns causes a row of query results to wrap multiple times. Conseque...
Embrace asked 7/3, 2012 at 15:52
1
Solved
Catch2 and Boost.Test provide similar features for writing unit tests.
For a certain project I have to use Boost.Test instead of Catch2.
The problem I have is that both use different format outputs...
Geisler asked 31/10, 2020 at 5:54
4
Solved
I am debugging stored procedures, and right now I am interested in what ran in what order and which which parameters as opposed to how fast things ran and what may sneak in between and cause a slow...
Bybidder asked 23/11, 2010 at 15:26
3
Solved
I'm writing a command-line tool for Mac OS X that processes a bunch of files. I would like to show the user the current file being processed, but do not want a bazillion files polluting the termina...
Lepidosiren asked 16/6, 2010 at 23:46
1
Solved
When I Write-Host from my .ps1 file I see:
Parentfolder >> ChildFolder
When I output to a file, I see:
ParentFolder
>>
ChildFolder
I am using a simple write-host ($childgroup.name...
Gleam asked 4/10, 2019 at 16:21
5
Solved
I would like to output a progress indicator during my lengthy running algorithms. I can easily "bubble up" a progress value from within my algorithm (e.g. via invoking a provided function callback ...
Monetmoneta asked 18/1, 2013 at 9:9
5
Solved
The data.table has a nice feature that suppresses output to the head and tail of the table.
Is it possible to view / print more than 100 rows at once?
library(data.table)
## Convert the ubiquitou...
Patricide asked 28/8, 2012 at 15:31
2
Solved
I have the following file
[
{
"id": 1,
"name": "Arthur",
"age": "21"
},
{
"id": 2,
"name": "Richard",
"age": "32"
}
]
To display login and id together, I am using the following command...
Mesics asked 19/5, 2017 at 6:29
2
Solved
I am trying to create a table from a JSON file I am receiving from a RESTful API.
When I print the property of the json object I get an output like this:
PS> Write-Output JSON.Object
Object1 : @...
Gasperoni asked 11/12, 2016 at 17:47
3
I want to do the print the elements of a vector line by line in R like below
1
2
3
However, when I do paste(c(1,2,3), "\n") or paste(c(1,2,3),sep = "\n"), the new line never gets printed out. T...
Escudo asked 3/6, 2014 at 8:33
1
Solved
I want to print a long string to the RStudio console so that it does not get truncated.
> paste(1:300, letters, collapse=" ")
[1] "1 a 2 b 3 c 4 d 5 e 6 f 7 g 8 h 9 i
...
181 y 182 z 183 a 184...
Epenthesis asked 22/4, 2016 at 17:59
6
Solved
I have the following data frame in R:
> dframe
Mean Median
Candidates 85.68 60
NonCands 9.21 4
Multi 27.48 17
Mono 4.43 3
Multi NonCands 22.23 15
I want to print it into a file and keep it n...
Longboat asked 27/11, 2012 at 18:40
5
Solved
When I have a column in a local data frame, sometimes I get the message Variables not shown such as this (ridiculous) example just needed enough columns.
library(dplyr)
library(ggplot2) # for movie...
Jessejessee asked 18/3, 2014 at 5:41
3
I have a TraceSource object that I use to log the initialization of a VB.Net application. It has several TraceListeners attached:
ConsoleTraceListener
TextWriterTraceListener
EventLogTraceListen...
Calorific asked 31/10, 2010 at 7:54
3
Typically, Rounding to 2 decimal places is very easy with
printf("%.2lf",<variable>);
However, the rounding system will usually rounds to the nearest even. For example,
2.554 -> 2.55
2...
Sensorium asked 3/8, 2014 at 12:59
1
Say I have dataframe, c:
a=np.random.random((6,2))
c=pd.DataFrame(a)
c.columns=['A','B']
printing row 0 values:
print c.loc[(0),:]
results in:
A 0.220170
B 0.261467
Name: 0, dtype: float64
...
Burbank asked 18/6, 2014 at 21:41
3
Solved
For data frames there is no na.print option. Is there any workaround to suppress display of NAs?
Sample data frame:
df <- data.frame(
x=c("a","b","c","d"),
a=c(1,1,1,1),
b=c(1,1,1,NA),
c=c...
Complexity asked 22/10, 2013 at 11:13
1 Next >
© 2022 - 2025 — McMap. All rights reserved.