profile
viewpoint
Lars Yencken larsyencken @lifesum Stockholm, Sweden http://lars.yencken.org/ Engineer and former researcher in human languages, machine learning and web systems. Tech Lead at Grace Health

larsyencken/csvdiff 125

Generate a diff between two tabular datasets expressed in CSV files.

larsyencken/cjktools 19

Tools for processing CJK strings in Python

larsyencken/anytop 7

A command-line tool for viewing frequency distributions over streaming input.

dhotson/palette 4

Image color palette extraction

larsyencken/cjkdata 4

Data files for the cjktools package.

larsyencken/cookiecutter-go-service 4

A template for new Go projects.

larsyencken/coursera-ml-2013-notes 4

Study notes for Coursera's 2013 Q4 Machine Learning subject.

larsyencken/doko 3

A command-line utility and Python module which reports your current location.

larsyencken/cookiecutter-gitbook 2

A template for a new gitbook book.

larsyencken/docker-vm 2

A Vagrant recipe for a VM with Docker installed and nothing else.

startedawslabs/datawig

started time in 15 hours

push eventlarsyencken/dotvim

Lars Yencken

commit sha 8253b265c90de8c75539137b70e5ac0991ad4752

Don't bother with Python 2

view details

Lars Yencken

commit sha 7135ca58515c7762624ac970d9276c24d8086471

Bump plug.vim

view details

push time in 8 days

issue commentlarsyencken/csvdiff

KeyError when comparing csv files

csvdiff is a row based diff rather than a column based diff, so it doesn't detect column changes. In this case it's erroring because it expects the same columns in both files. I agree the error message could be better.

If you're able to generate the same column names, you should get a good diff out of it in JSON format.

On Tue, 6 Oct 2020 at 14:29, Yash Kothari notifications@github.com wrote:

I have the following 2 csv files,

view-1.csv

As of Date,Business Title,Email,Employee Type,Employee_ID

view-2.csv

'As of Date',As of Date,Business Title,Email,Employee Type,Employee_ID

Running

$ csvdiff Employee_ID view-1.csv view-2.csv

Throws the following error,

Traceback (most recent call last): File "/Users/.pyenv/versions/3.7.5/bin/csvdiff", line 8, in <module> sys.exit(csvdiff_cmd()) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/click/core.py", line 829, in call return self.main(*args, **kwargs) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/csvdiff/init.py", line 160, in csvdiff_cmd significance=significance) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/csvdiff/init.py", line 172, in _diff_files_to_stream diff = diff_files(from_csv, to_csv, index_columns, sep=sep, ignored_columns=ignored_columns) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/csvdiff/init.py", line 44, in diff_files ignore_columns=ignored_columns) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/csvdiff/patch.py", line 211, in create return create_indexed(from_indexed, to_indexed, index_columns) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/csvdiff/patch.py", line 222, in create_indexed index_columns) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/csvdiff/patch.py", line 252, in _assemble key=change_key) File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/csvdiff/patch.py", line 251, in <genexpr> for k in changed), File "/Users/.pyenv/versions/3.7.5/lib/python3.7/site-packages/csvdiff/patch.py", line 264, in record_diff from = lhs[k] KeyError: "'As of Date'"

I was expecting the output to be something like columns removed/added: 1, 'As of Date'.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/larsyencken/csvdiff/issues/60, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIZLBF6TQF56TFHLQUBQTSJMER7ANCNFSM4SF6S4VA .

CaptainDaVinci

comment created time in 21 days

startednodejs/node-gyp

started time in a month

startedtreatwell/restricted-section

started time in a month

startedgoogle/jax

started time in a month

startedfoxlet/macOS-Simple-KVM

started time in 2 months

push eventlarsyencken/dotvim

Lars Yencken

commit sha 2336093079160e58d77bb1cc36be13df24f78552

Enable folding for js

view details

push time in 2 months

startedTylerBrock/saw

started time in 2 months

issue commentjunegunn/goyo.vim

Undefined variable: t:goyo_pads

This is probably not super helpful, but I was using a vim line that made vim quit if no buffers were alive:

" quit if no buffers are alive
autocmd BufDelete * if len(filter(range(1, bufnr('$')), '! empty(bufname(v:val)) && buflisted(v:val)')) == 1 | quit | endif

It turns out that this made Goyo fail horribly, causing the undefined variable above. Removing it made everything work again.

eater

comment created time in 3 months

push eventlarsyencken/dotvim

Lars Yencken

commit sha d36a7209a5f49c8e036d79382c96ae7bf13359a0

Move js files to 2-spaced

view details

push time in 3 months

push eventlarsyencken/dotvim

Lars Yencken

commit sha 62011d2e3316bc0783254b5a196b4b2fbfe6522d

Vimwiki gets markdown snippets

view details

push time in 3 months

more