How do I create a Step Graph in Excel? - excel

Suppose I have a set of values: <0-4.5, 1>, <4.6-9.3, 2>, <9.4-12.2, 3> and I want to display a simple, three step graph. One step would span from zero to 4.5 and the height should be 1, the second step from 4.6 to 9.3 and the height would be 2 and so on.
How do I do it in Excel?
Edit: A hack would be to generate pairs: <0,1>, <0.1,1>...<4.4,1>, <4.5,1> and use a scatter graph. But, really!

I'm not sure exactly how you want the graph to look, but another workaround is to select a scatter joined by lines. If you want a gap anywhere, put in a missing value:
+------+---+
| x | y |
+------+---+
| 0 | 0 |
| 0 | 1 |
| 4.5 | 1 |
| 4.5 | 0 |
| | |
| 4.6 | 0 |
| 4.6 | 2 |
| 9.3 | 2 |
| 9.3 | 0 |
| | |
| 9.4 | 0 |
| 9.4 | 3 |
| 12.2 | 3 |
| 12.2 | 0 |
+------+---+

Use the following data set:
| x | y |
|------|---|
| 0.1 | 1 |
| 0.2 | 1 |
| 0.3 | 1 |
| 0.4 | 1 |
| 0.5 | 1 |
| 0.6 | 1 |
| 0.7 | 1 |
| 0.8 | 1 |
| 0.9 | 1 |
| 1 | 1 |
| 1.1 | 1 |
| 1.2 | 1 |
| 1.3 | 1 |
| 1.4 | 1 |
| 1.5 | 1 |
| 1.6 | 1 |
| 1.7 | 1 |
| 1.8 | 1 |
| 1.9 | 1 |
| 2 | 1 |
| 2.1 | 1 |
| 2.2 | 1 |
| 2.3 | 1 |
| 2.4 | 1 |
| 2.5 | 1 |
| 2.6 | 1 |
| 2.7 | 1 |
| 2.8 | 1 |
| 2.9 | 1 |
| 3 | 1 |
| 3.1 | 1 |
| 3.2 | 1 |
| 3.3 | 1 |
| 3.4 | 1 |
| 3.5 | 1 |
| 3.6 | 1 |
| 3.7 | 1 |
| 3.8 | 1 |
| 3.9 | 1 |
| 4 | 1 |
| 4.1 | 1 |
| 4.2 | 1 |
| 4.3 | 1 |
| 4.4 | 1 |
| 4.5 | 1 |
| 4.6 | 2 |
| 4.7 | 2 |
| 4.8 | 2 |
| 4.9 | 2 |
| 5 | 2 |
| 5.1 | 2 |
| 5.2 | 2 |
| 5.3 | 2 |
| 5.4 | 2 |
| 5.5 | 2 |
| 5.6 | 2 |
| 5.7 | 2 |
| 5.8 | 2 |
| 5.9 | 2 |
| 6 | 2 |
| 6.1 | 2 |
| 6.2 | 2 |
| 6.3 | 2 |
| 6.4 | 2 |
| 6.5 | 2 |
| 6.6 | 2 |
| 6.7 | 2 |
| 6.8 | 2 |
| 6.9 | 2 |
| 7 | 2 |
| 7.1 | 2 |
| 7.2 | 2 |
| 7.3 | 2 |
| 7.4 | 2 |
| 7.5 | 2 |
| 7.6 | 2 |
| 7.7 | 2 |
| 7.8 | 2 |
| 7.9 | 2 |
| 8 | 2 |
| 8.1 | 2 |
| 8.2 | 2 |
| 8.3 | 2 |
| 8.4 | 2 |
| 8.5 | 2 |
| 8.6 | 2 |
| 8.7 | 2 |
| 8.8 | 2 |
| 8.9 | 2 |
| 9 | 2 |
| 9.1 | 2 |
| 9.2 | 2 |
| 9.3 | 2 |
| 9.4 | 3 |
| 9.5 | 3 |
| 9.6 | 3 |
| 9.7 | 3 |
| 9.8 | 3 |
| 9.9 | 3 |
| 10 | 3 |
| 10.1 | 3 |
| 10.2 | 3 |
| 10.3 | 3 |
| 10.4 | 3 |
| 10.5 | 3 |
| 10.6 | 3 |
| 10.7 | 3 |
| 10.8 | 3 |
| 10.9 | 3 |
| 11 | 3 |
| 11.1 | 3 |
| 11.2 | 3 |
| 11.3 | 3 |
| 11.4 | 3 |
| 11.5 | 3 |
| 11.6 | 3 |
| 11.7 | 3 |
| 11.8 | 3 |
| 11.9 | 3 |
| 12 | 3 |
| 12.1 | 3 |
Highlight the data set, and insert a chart using Recommended Charts and pick the one you prefer as shown below.
It can be a bar chart or line chart not necessarily a scatter chart, but the preparation is similar. Charting is not that intuitive in excel and needs a lot of workarounds sometimes.
Cheers :)

Related

How to create a calculated column in access 2013 to detect duplicates

I'm recreating a tool I made in Excel as it's getting bigger and performance is getting out of hand.
The issue is that I only have MS Access 2013 on my work laptop and I'm fairly new to the Expression Builder in Access 2013, which has a very limited function base to be honest.
My data has duplicates on the [Location] column, meaning that, I have multiple SKUs on that warehouse location. However, some of my calculations need to be done only once per [Location]. My solution to that, in Excel, was to make a formula (see below) putting 1 only on the first appearance of that location, putting 0 on next appearances. Doing that works like a charm because summing over that [Duplicate] column while imposing multiple criteria returns the number of occurrences of the multiple criteria counting locations only once.
Now, MS Access 2013 Expression Builder has no SUM nor COUNT functions to create a calculated column emulating my [Duplicate] column from Excel. Preferably, I would just input the raw data and let Access populate the calculated fields vs also inputting the calculated fields as well, since that would defeat my original purpose of reducing the computational cost of creating my dashboard.
The question is, how would you create a calculated column, in MS Access 2013 Expression Builder to recreate the below Excel function:
= IF($D$2:$D3=$D4,0,1)
In the sake of reducing the file size (over 100K rows) I even replace the 0 by a blank character "".
Thanks in advance for your help
Y
First and foremost, understand MS Access' Expression Builder is a convenience tool to build an SQL expression. Everything in Query Design ultimately is to build an SQL query. For this reason, you have to use a set-based mentality to see data in whole sets of related tables and not cell-by-cell mindset.
Specifically, to achieve:
putting 1 only on the first appearance of that location, putting 0 on next appearances
Consider a whole set-based approach by joining on a separate, aggregate query to identify the first value of your needed grouping, then calculate needed IIF expression. Below assumes you have an autonumber or primary key field in table (a standard in relational databases):
Aggregate Query (save as a separate query, adjust columns as needed)
SELECT ColumnD, MIN(AutoNumberID) As MinID
FROM myTable
GROUP BY ColumnD
Final Query (join to original table and build final IIF expression)
SELECT m.*, IIF(agg.MinID = AutoNumberID, 1, 0) As Dup_Indicator
FROM myTable m
INNER JOIN myAggregateQuery agg
ON m.[ColumnD] = agg.ColumnD
To demonstrate with random data:
Original
| ID | GROUP | INT | NUM | CHAR | BOOL | DATE |
|----|--------|-----|--------------|------|-------|------------|
| 1 | r | 9 | 1.424490258 | B6z | TRUE | 7/4/1994 |
| 2 | stata | 10 | 2.591235683 | h7J | FALSE | 10/5/1971 |
| 3 | spss | 6 | 0.560461966 | Hrn | TRUE | 11/27/1990 |
| 4 | stata | 10 | -1.499272175 | eXL | FALSE | 4/17/2010 |
| 5 | stata | 15 | 1.470269177 | Vas | TRUE | 6/13/2010 |
| 6 | r | 14 | -0.072238898 | puP | TRUE | 4/1/1994 |
| 7 | julia | 2 | -1.370405263 | S2l | FALSE | 12/11/1999 |
| 8 | spss | 6 | -0.153684675 | mAw | FALSE | 7/28/1977 |
| 9 | spss | 10 | -0.861482674 | cxC | FALSE | 7/17/1994 |
| 10 | spss | 2 | -0.817222582 | GRn | FALSE | 10/19/2012 |
| 11 | stata | 2 | 0.949287754 | xgc | TRUE | 1/18/2003 |
| 12 | stata | 5 | -1.580841322 | Y1D | TRUE | 6/3/2011 |
| 13 | r | 14 | -1.671303816 | JCP | FALSE | 5/15/1981 |
| 14 | r | 7 | 0.904181025 | Rct | TRUE | 7/24/1977 |
| 15 | stata | 10 | -1.198211174 | qJY | FALSE | 5/6/1982 |
| 16 | julia | 10 | -0.265808162 | 10s | FALSE | 3/18/1975 |
| 17 | r | 13 | -0.264955027 | 8Md | TRUE | 6/11/1974 |
| 18 | r | 4 | 0.518302149 | 4KW | FALSE | 9/12/1980 |
| 19 | r | 5 | -0.053620183 | 8An | FALSE | 4/17/2004 |
| 20 | r | 14 | -0.359197116 | F8Q | TRUE | 6/14/2005 |
| 21 | spss | 11 | -2.211875193 | AgS | TRUE | 4/11/1973 |
| 22 | stata | 4 | -1.718749471 | Zqr | FALSE | 2/20/1999 |
| 23 | python | 10 | 1.207878576 | tcC | FALSE | 4/18/2008 |
| 24 | stata | 11 | 0.548902226 | PFJ | TRUE | 9/20/1994 |
| 25 | stata | 6 | 1.479125922 | 7a7 | FALSE | 3/2/1989 |
| 26 | python | 10 | -0.437245299 | r32 | TRUE | 6/7/1997 |
| 27 | sas | 14 | 0.404746106 | 6NJ | TRUE | 9/23/2013 |
| 28 | stata | 8 | 2.206741458 | Ive | TRUE | 5/26/2008 |
| 29 | spss | 12 | -0.470694096 | dPS | TRUE | 5/4/1983 |
| 30 | sas | 15 | -0.57169507 | yle | TRUE | 6/20/1979 |
SQL (uses aggregate in subquery but can be a stored query)
SELECT r.*, IIF(sub.MinID = r.ID,1, 0) AS Dup
FROM Random_Data r
LEFT JOIN
(
SELECT r.GROUP, MIN(r.ID) As MinID
FROM Random_Data r
GROUP BY r.Group
) sub
ON r.[Group] = sub.[GROUP]
Output (notice the first GROUP value is tagged 1, all else 0)
| ID | GROUP | INT | NUM | CHAR | BOOL | DATE | Dup |
|----|--------|-----|--------------|------|-------|------------|-----|
| 1 | r | 9 | 1.424490258 | B6z | TRUE | 7/4/1994 | 1 |
| 2 | stata | 10 | 2.591235683 | h7J | FALSE | 10/5/1971 | 1 |
| 3 | spss | 6 | 0.560461966 | Hrn | TRUE | 11/27/1990 | 1 |
| 4 | stata | 10 | -1.499272175 | eXL | FALSE | 4/17/2010 | 0 |
| 5 | stata | 15 | 1.470269177 | Vas | TRUE | 6/13/2010 | 0 |
| 6 | r | 14 | -0.072238898 | puP | TRUE | 4/1/1994 | 0 |
| 7 | julia | 2 | -1.370405263 | S2l | FALSE | 12/11/1999 | 1 |
| 8 | spss | 6 | -0.153684675 | mAw | FALSE | 7/28/1977 | 0 |
| 9 | spss | 10 | -0.861482674 | cxC | FALSE | 7/17/1994 | 0 |
| 10 | spss | 2 | -0.817222582 | GRn | FALSE | 10/19/2012 | 0 |
| 11 | stata | 2 | 0.949287754 | xgc | TRUE | 1/18/2003 | 0 |
| 12 | stata | 5 | -1.580841322 | Y1D | TRUE | 6/3/2011 | 0 |
| 13 | r | 14 | -1.671303816 | JCP | FALSE | 5/15/1981 | 0 |
| 14 | r | 7 | 0.904181025 | Rct | TRUE | 7/24/1977 | 0 |
| 15 | stata | 10 | -1.198211174 | qJY | FALSE | 5/6/1982 | 0 |
| 16 | julia | 10 | -0.265808162 | 10s | FALSE | 3/18/1975 | 0 |
| 17 | r | 13 | -0.264955027 | 8Md | TRUE | 6/11/1974 | 0 |
| 18 | r | 4 | 0.518302149 | 4KW | FALSE | 9/12/1980 | 0 |
| 19 | r | 5 | -0.053620183 | 8An | FALSE | 4/17/2004 | 0 |
| 20 | r | 14 | -0.359197116 | F8Q | TRUE | 6/14/2005 | 0 |
| 21 | spss | 11 | -2.211875193 | AgS | TRUE | 4/11/1973 | 0 |
| 22 | stata | 4 | -1.718749471 | Zqr | FALSE | 2/20/1999 | 0 |
| 23 | python | 10 | 1.207878576 | tcC | FALSE | 4/18/2008 | 1 |
| 24 | stata | 11 | 0.548902226 | PFJ | TRUE | 9/20/1994 | 0 |
| 25 | stata | 6 | 1.479125922 | 7a7 | FALSE | 3/2/1989 | 0 |
| 26 | python | 10 | -0.437245299 | r32 | TRUE | 6/7/1997 | 0 |
| 27 | sas | 14 | 0.404746106 | 6NJ | TRUE | 9/23/2013 | 1 |
| 28 | stata | 8 | 2.206741458 | Ive | TRUE | 5/26/2008 | 0 |
| 29 | spss | 12 | -0.470694096 | dPS | TRUE | 5/4/1983 | 0 |
| 30 | sas | 15 | -0.57169507 | yle | TRUE | 6/20/1979 | 0 |

Auto Incrementing Number Values in Excel

I have to re-number over 30,000 rows in excel and am looking for a way to do this through an embedded excel function.
I have two columns, the original BuildingCount and the Test column. In the BuildingCount column, I have inconsistent count that needs to be consecutive 1,2,3 numbers in order to run a macros. However, the numbers are not always consecutive. I have been writing different variations of excel functions. The below is the output for =IF(A2>1),A2+1,1)
+----+---------------+------------+
| | A | B |
+----+---------------+------------+
| 1 | BuildingCount | TestColumn |
| 2 | 1 | #VALUE! |
| 3 | 2 | 1 |
| 4 | 3 | 3 |
| 5 | 5 | 4 |
| 6 | 6 | 6 |
| 7 | 9 | 7 |
| 8 | 1 | 10 |
| 9 | 2 | 1 |
| 10 | 3 | 3 |
| 11 | 4 | 4 |
| 12 | 5 | 5 |
+----+---------------+------------+
Ideally, the output would be the following:
+----+---------------+------------+
| | A | B |
+----+---------------+------------+
| 1 | BuildingCount | TestColumn |
| 2 | 1 | 1 |
| 3 | 2 | 2 |
| 4 | 3 | 3 |
| 5 | 5 | 4 |
| 6 | 6 | 5 |
| 7 | 7 | 6 |
| 8 | 1 | 1 |
| 9 | 2 | 2 |
| 10 | 3 | 3 |
| 11 | 4 | 4 |
| 12 | 5 | 5 |
+----+---------------+------------+
Any ideas would be very welcomed.
Formula in B2:
=IF(ROW()=2,1,IF(A2>A1,B1+1,1))
And dragged down

SIGN() formula returns unexpected results

In continuation of my previous question: Sumproduct with multiple criteria on one range
Jeeped provided me with an very helpful formula to achieve a sumproduct() which takes multiple criteria. My current case is however a bit broader:
Take these example tables:
First column is the ID number, second column a respondent group(A,B). Column headers are question types (X,Y,Z).
Table Q1
| | | X | Y | Y | Z | Y |
|----|---|---|---|---|---|---|
| 1 | A | 2 | 2 | 1 | | 1 |
| 2 | A | 1 | 1 | | | 2 |
| 3 | A | 1 | 1 | | | 1 |
| 4 | A | 2 | 1 | | | 1 |
| 5 | A | 1 | 2 | 1 | | 1 |
| 6 | A | 1 | 1 | | | 1 |
| 7 | A | | | | | |
| 8 | A | | | | | |
| 9 | A | 1 | 1 | | | 1 |
| 10 | A | 2 | 2 | 2 | | 2 |
| 11 | A | | | | | |
| 12 | A | 1 | 2 | 1 | | 2 |
| 13 | B | | | | | |
| 14 | B | 1 | 1 | | | 1 |
| 15 | B | 2 | 2 | 1 | | 1 |
Table Q2
| | | X | Y | Y | Z | Y |
|----|---|---|---|---|---|---|
| 1 | A | 1 | 2 | 1 | | 1 |
| 2 | A | 1 | 1 | | | 1 |
| 3 | A | 1 | 1 | | | 1 |
| 4 | A | 1 | 1 | | | 1 |
| 5 | A | 1 | 1 | | | 1 |
| 6 | A | 1 | 1 | | | 1 |
| 7 | A | | | | | |
| 8 | A | | | | | |
| 9 | A | 1 | 1 | | | 1 |
| 10 | A | 1 | 1 | | | 1 |
| 11 | A | | | | | |
| 12 | A | 1 | 2 | 1 | | 1 |
| 13 | B | | | | | |
| 14 | B | 1 | 1 | | | 1 |
| 15 | B | 1 | 2 | 1 | | 1 |
Now I want to know the amount of times a respondent answered 1 (yes) on Q2 for each question type (X,Y,Z). The catch is that if someone answered 1 (yes) on Q1 it should "override" the answer on Q2, as we assume that when someone answers yes on Q1 (implementation of a measure), their answer on Q2 (knowledge of said measure) has to be yes as well.
The second catch is that for the first two occurrences of Y there can only be yes in one of both columns, so in fact there can only be two yes answers for question type Y for each respondent.
I used the following formula (on sheet 3): =SUMPRODUCT(SIGN(('Q1'!$C$2:$G$16=1)+('Q2'!$C$2:$G$16=1))*('Q2'!$B$2:$B$16=Blad3!$D5)*('Q2'!$C$1:$G$1=Blad3!E$4)) to obtain the following results.
| | X | Y | Z |
|---|---|----|---|
| A | 9 | 19 | 0 |
| B | 2 | 4 | 0 |
For X these results are correct, as there are 9 1's in table Q2.
For Y the results for B are correct, for A however they are not, as there are only 9 respondents, answering max 2 questions would result in a max of 18, we have 19 however.
It turns out there is nothing wrong with the formula, just that it isn't suited for the way this data is organised. If you look at row 5:
Q1
| | | X | Y | Y | Z | Y |
|----|---|---|---|---|---|---|
| 5 | A | 1 | 2 | 1 | | 1 |
Q2
| | | X | Y | Y | Z | Y |
|----|---|---|---|---|---|---|
| 5 | A | 1 | 1 | | | 1 |
If we condense that to everywhere there is a 1 in any of the Y column we get this table:
| | | X | Y | Y | Z | Y |
|----|---|---|---|---|---|---|
| 5 | A | | 1 | 1 | | 1 |
When I ask for the sumproduct() for this combined table the result will be 3.
To prevent this I added a helper column (between the two Y and the Z column) to my tables, with the following formula: IF(OR(D1=1,E1=1),1,""). Removed the headers from the double Y columns, and re-running the query produced the correct results.
New table Q1 looks like this then:
| | | X | | | Y | Z | Y |
|----|---|---|---|---|---|---|---|
| 1 | A | 2 | 2 | 1 | 1 | | 1 |
| 2 | A | 1 | 1 | | 1 | | 2 |
| 3 | A | 1 | 1 | | 1 | | 1 |
| 4 | A | 2 | 1 | | 1 | | 1 |
| 5 | A | 1 | 2 | 1 | 1 | | 1 |
| 6 | A | 1 | 1 | | 1 | | 1 |
| 7 | A | | | | | | |
| 8 | A | | | | | | |
| 9 | A | 1 | 1 | | 1 | | 1 |
| 10 | A | 2 | 2 | 2 | | | 2 |
| 11 | A | | | | | | |
| 12 | A | 1 | 2 | 1 | 1 | | 2 |
| 13 | B | | | | | | |
| 14 | B | 1 | 1 | | 1 | | 1 |
| 15 | B | 2 | 2 | 1 | 1 | | 1 |

How do I create condense list in Excel using formula (not VBA)

I am new to this site and haven't done much in Excel of decades (yes, decades), so I forgotten more than I know now.
Background: I am working on a simple pay sheet checking spreadsheet. One Worksheet is input timesheet for data entry, the complex one does all the calculations (Hourly rate; shift loading; tax formula, etc.) and the final worksheet presents the results in the same format as pay slip. Having finished the complex formulas in the calculation sheet, I am now stuck on condensing the results for the final results on the last sheet. I have try numerous functions including: vlookup, index, match, rank.eq, small and others, as per examples of other question on this site. Sample data is:
+----+-----------------------------------------------------+----------------+------------+--------------+--------+--------+-----+--------+
| | A | B | C | D | E | F | G | H |
+----+-----------------------------------------------------+----------------+------------+--------------+--------+--------+-----+--------+
| 1 | Sample data: | | | | | | | |
| 2 | Monday | Ordinary Hours | 30/04/2018 | Day Shift | 10.85 | 21.85 | 1 | 237.07 |
| 3 | Tuesday | Ordinary Hours | 1/05/2018 | | | 21.85 | 1 | |
| 4 | Wednesday | Ordinary Hours | 2/05/2018 | | | 21.85 | 1 | |
| 5 | Thursday | Ordinary Hours | 3/05/2018 | | | 21.85 | 1 | |
| 6 | Friday | Ordinary Hours | 4/05/2018 | | | 21.85 | 1 | |
| 7 | | | | | | | | |
| 8 | | | | | | | | |
| 9 | Monday | Ordinary Hours | 7/05/2018 | | | 21.85 | 1 | |
| 10 | Tuesday | Ordinary Hours | 8/05/2018 | | | 21.85 | 1 | |
| 11 | Wednesday | Ordinary Hours | 9/05/2018 | Day Shift | 10.85 | 21.85 | 1 | 237.07 |
| 12 | Thursday | Ordinary Hours | 10/05/2018 | Day Shift | 10.85 | 21.85 | 1 | 237.07 |
| 13 | Friday | Ordinary Hours | 11/05/2018 | | | 21.85 | 1 | |
| 14 | | | | | | | | |
| 15 | Monday | Overtime 1.5 | 30/04/2018 | | | 21.85 | 1.5 | |
| 16 | Tuesday | Overtime 1.5 | 1/05/2018 | Overtime 1.5 | 2 | 21.85 | 1.5 | 65.55 |
| 17 | Wednesday | Overtime 1.5 | 2/05/2018 | | | 21.85 | 1.5 | |
| 18 | Thursday | Overtime 1.5 | 3/05/2018 | | | 21.85 | 1.5 | |
| 19 | Friday | Overtime 1.5 | 4/05/2018 | | | 21.85 | 1.5 | |
| 20 | Saturday | Overtime 1.5 | 5/05/2018 | | | 21.85 | 1.5 | |
| 21 | | | | | | | | |
| 22 | Monday | Overtime 1.5 | 7/05/2018 | | | 21.85 | 1.5 | |
| 23 | Tuesday | Overtime 1.5 | 8/05/2018 | | | 21.85 | 1.5 | |
| 24 | Wednesday | Overtime 1.5 | 9/05/2018 | | | 21.85 | 1.5 | |
| 25 | Thursday | Overtime 1.5 | 10/05/2018 | | | 21.85 | 1.5 | |
| 26 | Friday | Overtime 1.5 | 11/05/2018 | | | 21.85 | 1.5 | |
| 27 | Saturday | Overtime 1.5 | 12/05/2018 | | | 21.85 | 1.5 | |
| 28 | | | | | | | | |
| 29 | | | | | | | | |
| 30 | Required result on separate sheet in same workbook: | | | | | | | |
| 31 | Taxable Allowances | Comments | Qty | Rate | Factor | Amount | | |
| 32 | Ordinary Hours | 30/04/2018 | 10.85 | 21.85 | 1 | 237.07 | | |
| 33 | Ordinary Hours | 9/05/2018 | 10.85 | 21.85 | 1 | 237.07 | | |
| 34 | Ordinary Hours | 10/05/2018 | 10.85 | 21.85 | 1 | 237.07 | | |
| 35 | Overtime 1.5 | 1/05/2018 | 2 | 21.85 | 1.5 | 65.55 | | |
| 36 | | | | | | | | |
| 37 | | | | | | | | |
| 38 | | | | | | | | |
| 39 | | | | | | | | |
| 40 | | | | | | | | |
+----+-----------------------------------------------------+----------------+------------+--------------+--------+--------+-----+--------+

How to pretty print the csv which has long columns from command line?

I want to view and pretty print this csv file from command line. For this purpose I am using csvlook nupic_out.csv | less -#2 -N -S command. The problem is that this csv file has very long one column (it is the 5th - multiStepPredictions.1) Everything up to this column is displayed properly
1 -----------------+--------------------+-----------------------------+------------------------------------------------------------------------------------------------------------------------------------
2 angle | sine | multiStepPredictions.actual | multiStepPredictions.1
3 -----------------+--------------------+-----------------------------+------------------------------------------------------------------------------------------------------------------------------------
4 string | string | string | string
5 | | |
6 0.0 | 0.0 | 0.0 | None
7 0.0314159265359 | 0.0314107590781 | 0.0314107590781 | {0.0: 1.0}
8 0.0628318530718 | 0.0627905195293 | 0.0627905195293 | {0.0: 0.0039840637450199202 0.03141075907812829: 0.99601593625497931}
9 0.0942477796077 | 0.0941083133185 | 0.0941083133185 | {0.03141075907812829: 1.0}
10 0.125663706144 | 0.125333233564 | 0.125333233564 | {0.06279051952931337: 0.98942669172932329 0.03141075907812829: 0.010573308270676691}
11 0.157079632679 | 0.15643446504 | 0.15643446504 | {0.03141075907812829: 0.0040463956041429626 0.09410831331851431: 0.94917381047888194 0.06279051952931337: 0.04677979391
12 0.188495559215 | 0.187381314586 | 0.187381314586 | {0.12533323356430426: 0.85789473684210527 0.09410831331851431: 0.14210526315789476}
13 0.219911485751 | 0.218143241397 | 0.218143241397 | {0.15643446504023087: 0.63177315983686211 0.12533323356430426: 0.26859584385317475 0.09410831331851431: 0.09963099630
14 0.251327412287 | 0.248689887165 | 0.248689887165 | {0.06279051952931337: 0.3300438596491227 0.1873813145857246: 0.47381368550527647 0.15643446504023087: 0.12643231695
15 0.282743338823 | 0.278991106039 | 0.278991106039 | {0.21814324139654254: 0.56140350877192935 0.03141075907812829: 0.0032894736842105313 0.1873813145857246: 0.105263157894
16 0.314159265359 | 0.309016994375 | 0.309016994375 | {0.2486898871648548: 0.8228480378168288 0.03141075907812829: 0.0029688002160632981 0.1873813145857246: 0.022936632244020292
17 0.345575191895 | 0.338737920245 | 0.338737920245 | {0.2486898871648548: 0.13291723147401985 0.2789911060392293: 0.77025390613412514 0.21814324139654254: 0.06654338668
18 0.376991118431 | 0.368124552685 | 0.368124552685 | {0.2486898871648548: 0.10230061459892241 0.2789911060392293: 0.14992465949587844 0.21814324139654254: 0.06517018413
19 0.408407044967 | 0.397147890635 | 0.397147890635 | {0.33873792024529137: 0.67450197451277849 0.2486898871648548: 0.028274124758268366 0.2789911060392293: 0.077399230934
20 0.439822971503 | 0.425779291565 | 0.425779291565 | {0.33873792024529137: 0.17676914536466748 0.3681245526846779: 0.6509556160617509 0.2486898871648548: 0.04784688995215327
21 0.471238898038 | 0.45399049974 | 0.45399049974 | {0.33873792024529137: 0.038582651338955089 0.3681245526846779: 0.14813277049357607 0.2486898871648548: 0.029239766081
22 0.502654824574 | 0.481753674102 | 0.481753674102 | {0.3681245526846779: 0.035163881050575212 0.42577929156507266: 0.61447711863333254 0.2486898871648548: 0.015554881705
23 0.53407075111 | 0.50904141575 | 0.50904141575 | {0.33873792024529137: 0.076923076923077108 0.42577929156507266: 0.11307647489430354 0.45399049973954675: 0.66410206612
24 0.565486677646 | 0.535826794979 | 0.535826794979 | {0.42577929156507266: 0.035628438284964516 0.45399049973954675: 0.22906083786048709 0.3971478906347806: 0.014132015120
25 0.596902604182 | 0.562083377852 | 0.562083377852 | {0.5090414157503713: 0.51578106597362727 0.45399049973954675: 0.095000708551421106 0.06279051952931337: 0.08649420683
26 0.628318530718 | 0.587785252292 | 0.587785252292 | {0.5090414157503713: 0.10561370056909389 0.45399049973954675: 0.063130123291224485 0.5358267949789967: 0.617348556187
27 0.659734457254 | 0.612907053653 | 0.612907053653 | {0.5090414157503713: 0.036017118165629407 0.45399049973954675: 0.013316643552779454 0.5358267949789967: 0.236874795987
28 0.69115038379 | 0.637423989749 | 0.637423989749 | {0.2486898871648548: 0.037593984962406228 0.21814324139654254: 0.033834586466165564 0.5358267949789967: 0.085397996837
29 0.722566310326 | 0.661311865324 | 0.661311865324 | {0.6129070536529765: 0.49088597257034694 0.2486898871648548: 0.072573707671854309 0.06279051952931337: 0.04684445139
30 0.753982236862 | 0.684547105929 | 0.684547105929 | {0.6129070536529765: 0.16399317807418579 0.2486898871648548: 0.066194656736965368 0.2789911060392293: 0.015074193295
But everything displayed behind this column is garbage
1 --------------------------------------------------------------------------------------------------------+--------------+---------------------------------+----------------------------+--------------+---
2 | anomalyScore | multiStepBestPredictions.actual | multiStepBestPredictions.1 | anomalyLabel | mu
3 --------------------------------------------------------------------------------------------------------+--------------+---------------------------------+----------------------------+--------------+---
4 | string | string | string | string | fl
5 | | | | |
6 | 1.0 | 0.0 | None | [] | 0
7 | 1.0 | 0.0314107590781 | 0.0 | [] | 10
8 | 1.0 | 0.0627905195293 | 0.0314107590781 | []
9 | 1.0 | 0.0941083133185 | 0.0314107590781 | [] | 66
10 | 1.0 | 0.125333233564 | 0.0627905195293 | []
11 | 1.0 | 0.15643446504 | 0.0941083133185 | []
12 | 1.0 | 0.187381314586 | 0.125333233564 | []
13 | 1.0 | 0.218143241397 | 0.15643446504 | []
14 | 1.0 | 0.248689887165 | 0.187381314586
15 | 1.0 | 0.278991106039 | 0.218143241397 |
16 | 1.0 | 0.309016994375 | 0.248689887165 | []
17 | 1.0 | 0.338737920245 | 0.278991106039
18 075907812829: 0.0008726186745285988 0.3090169943749474: 0.36571033632089267 0.15643446504023087: 0.15263157894736851} | 1.0 | 0.368124552685 | 0.30
19 69943749474: 0.12243639244611626 0.15643446504023087: 0.076923076923077024} | 1.0 | 0.397147890635 | 0.33873792
20 474: 0.042824288244468607} | 1.0 | 0.425779291565 | 0.368124552685
21 78906347806: 0.72014752277063943 0.3090169943749474: 0.019779736758565116} | 1.0 | 0.45399049974 | 0.39714789
22 323356430426: 0.030959752321981428 0.09410831331851431: 0.027863777089783253} | 1.0 | 0.481753674102 | 0.425779291
23 831331851431: 0.036437246963562819} | 1.0 | 0.50904141575 | 0.45399049974
24 831331851431: 0.011027980232581683} | 1.0 | 0.535826794979 | 0.481753674102
25 929156507266: 0.027856989831229011 0.15643446504023087: 0.02066616653788458 0.09410831331851431: 0.016739594895686508} | 1.0 | 0.562083377852 | 0.5090
26 13145857246: 0.08333333333333337 0.42577929156507266: 0.025020076940584089} | 1.0 | 0.587785252292 | 0.5358
27 075907812829: 0.0025974025974026035 0.5620833778521306: 0.59566175023106149} | 1.0 | 0.612907053653 | 0.5620833778
28 33778521306: 0.19639042255084313} one | 1.0 | 0.637423989749 | 0.587785252292
29 13145857246: 0.0046487548012272466 0.21814324139654254: 0.070071166027997234 0.5620833778521306: 0.087432430700408653} | 1.0 | 0.661311865324 | 0.612
30 39897486896: 0.53158336716673826 0.3090169943749474: 0.016749103661249369 0.5620833778521306: 0.027323827946545261} | 1.0 | 0.684547105929 | 0.6
How to pretty print whole csv?
PS: Similar garbage produces also following commands (inspiration here):
column -s, -t < nupic_out.csv | less -#2 -N -S
csvtool readable nupic_out.csv | less -#2 -N -S
I believe that csvlook is treating the tab characters in that column just like any other character, and doesn't know about their special behaviour.
The easiest way to get the columns to line up is to minimally expand the tabs:
expand -t1 nupic_out.csv | csvlook

Resources