0

I'm taking notes for a nanodegree on Data Analysis on a Jupyter Notebook (yes, I know I could use Microsoft Word and etc but I'd rather get more used to Jupyter).

I'm trying to visualize this table in a markdown cell but instead of showing the table like it's supposed to I just get a string. The alignment is irrelevant.

|workclass       |age      |fnlwgt       |education-num|capital-gain|capital-loss|hours-per-week|
|----------------|---------|-------------|-------------|------------|------------|--------------|
|Federal-gov     |42.590625|185221.243750|10.973958    |833.232292  |112.268750  |41.379167     |
|Local-gov   |41.751075|188639.712852|11.042045    |880.202580  |109.854276  |40.982800     |
|Never-worked    |20.571429|225989.571429|7.428571     |0.000000    |0.000000    |28.428571     |
|Private     |36.797585|192764.114734|9.879714     |889.217792  |80.008724   |40.267096     |
|Self-emp-inc    |46.017025|175981.344086|11.137097    |4875.693548 |155.138889  |48.818100     |
|Self-emp-not-inc|44.969697|175608.641480|10.226289    |1886.061787 |116.631641  |44.421881     |
|State-gov   |39.436055|184136.613251|11.375963    |701.699538  |83.256549   |39.031587     |
|Without-pay     |47.785714|174267.500000|9.071429     |487.857143  |0.000000    |32.714286     |

When I hit 'Run' it just shows something like this:

|workclass |age |fnlwgt |education-num|capital-gain|capital-loss|hours-per-week| |----------------|---------|-------------|-------------|------------|------------|--------------| |Federal-gov |42.590625|185221.243750|10.973958 |833.232292 |112.268750 |41.379167 | |Local-gov |41.751075|188639.712852|11.042045 |880.202580 |109.854276 |40.982800 | |Never-worked |20.571429|225989.571429|7.428571 |0.000000 |0.000000 |28.428571 | |Private |36.797585|192764.114734|9.879714 |889.217792 |80.008724 |40.267096 | |Self-emp-inc |46.017025|175981.344086|11.137097 |4875.693548 |155.138889 |48.818100 | |Self-emp-not-inc|44.969697|175608.641480|10.226289 |1886.061787 |116.631641 |44.421881 | |State-gov |39.436055|184136.613251|11.375963 |701.699538 |83.256549 |39.031587 | |Without-pay |47.785714|174267.500000|9.071429 |487.857143 |0.000000 |32.714286 |

Noemi
  • 15
  • 3

1 Answers1

0

Put a space before and after each separating pipe ('|'):

| workclass       | age      | fnlwgt       | education-num | capital-gain | capital-loss | hours-per-week |
|----------------|---------|-------------|-------------|------------|------------|--------------|
| Federal-gov     | 42.590625 | 185221.243750 | 10.973958    | 833.232292  | 112.268750  | 41.379167     |
| Local-gov   | 41.751075 | 188639.712852 | 11.042045    | 880.202580  | 109.854276  | 40.982800     |
| Never-worked    | 20.571429| 225989.571429 | 7.428571     | 0.000000    | 0.000000    | 28.428571     |
| Private     | 36.797585|192764.114734 | 9.879714     | 889.217792  | 80.008724   | 40.267096     |
| Self-emp-inc    | 46.017025 | 175981.344086 | 11.137097    | 4875.693548 | 155.138889  | 48.818100     |
| Self-emp-not-inc | 44.969697 | 175608.641480 | 10.226289    | 1886.061787 | 116.631641  | 44.421881     |
| State-gov   | 39.436055 | 184136.613251 | 11.375963    | 701.699538  | 83.256549   | 39.031587     |
| Without-pay     | 47.785714 | 174267.500000 | 9.071429     | 487.857143  | 0.000000    | 32.714286     |

Becomes

workclass age fnlwgt education-num capital-gain capital-loss hours-per-week
Federal-gov 42.590625 185221.243750 10.973958 833.232292 112.268750 41.379167
Local-gov 41.751075 188639.712852 11.042045 880.202580 109.854276 40.982800
Never-worked 20.571429 225989.571429 7.428571 0.000000 0.000000 28.428571
Private 36.797585 192764.114734 9.879714 889.217792 80.008724 40.267096
Self-emp-inc 46.017025 175981.344086 11.137097 4875.693548 155.138889 48.818100
Self-emp-not-inc 44.969697 175608.641480 10.226289 1886.061787 116.631641 44.421881
State-gov 39.436055 184136.613251 11.375963 701.699538 83.256549 39.031587
Without-pay 47.785714 174267.500000 9.071429 487.857143 0.000000 32.714286

Notice how there's a space between the first | and workclass.

Squirrelkiller
  • 2,575
  • 1
  • 22
  • 41