Earlier quoted context omitted.
You have never read documentation on something you’re not currently writing code with _right_ _now_? Or looked at documentation for something you worked on in the day as you’re on your way home from work? I opened it on mobile because I was interested in seeing how they differ, even though I’m not using either right now.
Well, I typically don't read a lot on mobile. Screen is too small and you can't block ads, which makes the screen even smaller.
Pandas vs. Julia – cheat sheet and comparison
71–80 of 138 posts
Re: Pandas vs. Julia – cheat sheet and comparison
#72Re: Pandas vs. Julia – cheat sheet and comparison
#73The thing that keeps me coming back to Julia is the ability to pipe (or whatever you want to call it). It makes DataFrame operations a lot cleaner since I don't need to modify in place or create new DFs at intermediate steps in a process. Here's a video showing this sort of workflow in R: https://youtu.be/W3e8qMBypSE
In pandas you can chain commands by wrapping the whole command in (). Personally IMO looks far 'cleaner' than all of the ugly %>% everywhere.
In R you can pipe a data frame into any function from any package or one you just wrote, so you use %>% for any piping that happens. In pandas, you have special pandas methods that don't need the pipe, but to pipe with any other function, you have to write .pipe.
The comparison is not really between %>% and ., it's between "you just use %>% for everything" and "you use . for a bloated, somewhat arbitrary collection of special pandas methods, and .pipe for everything else".
Re: Pandas vs. Julia – cheat sheet and comparison
#74Earlier quoted context omitted.
Indeed DataFrames.jl isn't and won't be the fastest way to do many things. It makes a lot of trade offs in performance for flexibility. The columns of the dataframe can be any indexable array, so while most examples use 64-bit floating point numbers, strings, and categorical arrays, the nice thing about DataFrames.jl is that using arbitrary precision floats, pointers to binaries, etc. are all fine inside of a DataFra…
I really hope people don't come from R to Julia. People who use R are not good programmers, and will degrade the core of the language and it's principles. It would be a shame to see the equivalent of tacking on 6 different object oriented systems to a base language and fragmenting the community completely.
Re: Pandas vs. Julia – cheat sheet and comparison
#75Earlier quoted context omitted.
Indeed DataFrames.jl isn't and won't be the fastest way to do many things. It makes a lot of trade offs in performance for flexibility. The columns of the dataframe can be any indexable array, so while most examples use 64-bit floating point numbers, strings, and categorical arrays, the nice thing about DataFrames.jl is that using arbitrary precision floats, pointers to binaries, etc. are all fine inside of a DataFra…
I really hope people don't come from R to Julia. People who use R are not good programmers, and will degrade the core of the language and it's principles. It would be a shame to see the equivalent of tacking on 6 different object oriented systems to a base language and fragmenting the community completely.
Re: Pandas vs. Julia – cheat sheet and comparison
#76Yeah this is basically why I keep trying and bouncing off Julia. I understand the real performance reasons why you'd choose to use Julia but the syntax is the perfect distance from python to make it extremely difficult to me. It's just close enough to get constantly confused. So if I really wanted to do much work in it I'd have swear off python - and I can't do that because for trivial stuff python is more convenient…
I have done both complex and trivial stuff in both languages and Julia isn't more inconvenient for trivial things.
At its most basic the obviouses becomes different:
Let's try to get a very simple object: a 3,3 matrix of random booleans in both languages: Julia:
A = rand(Bool,3,3)
Python: No standard support for Matrices. I could really do it a disservsice and comapre the "core language", but that''s obivously stupid so we'll bring in some external libraries to make it easier. Of many ways to skin the cat here's one.. Python
import numpy.numpy as np gen = np.random.default.default_rng() B = gen.choice([True,False],(3,3))
BTW julia has this choice function built into the command as well, so rand(["Which", "Word", "Will", "I", "get?"]) produces exactly what you'd expect.
----
Acutally I can't think of any cases at all off the top of my head. Sorry, I mean my np.somenamespace.another.namespace.sparce head :) I mean just going down the list of things that make code easier in Julia..
* Python requires a third party library for any kind of linear algebra. and matrix multiplication:*
A =[1 4;6 7"; B = [2 ;3]; A*B doesn't work, i.e. you literally even multiply a matrix! This is madness.you'll need yet again a third partly library
Python doesnt have broadcasting. let's apply sin(x) to a matrix a Pythonic(+ required third party libraries) import numpy as np
import math #sigh
x = np.array([1, 2, 3, 4, 5])
f = lambda x: sin(x)
Now in Julia (notice the . after sin) x=1:5 sin.(x)
or more explicity we could write broadcast(sin, x)Even basic string interpolation in Julia is a much nicer "trivial task" than in python alone
No special brackets, just clean "$myvar"
# Reading files is easier
Julia
readlines("my_test.txt")
Pythonopen("my_test.txt").readlines()
What a stupid option in 2? if I call readlines on a filename, 99% of people, 99% of the time, want to read the lines on the file at that path. Why require two function calls?
Re: Pandas vs. Julia – cheat sheet and comparison
#77Re: Pandas vs. Julia – cheat sheet and comparison
#78Anxiously waiting for pandas to get its mojo. If there is any Python library that needs it, this is it.
But this is a language flamewar thing, probably not a constructive comment, sorry.
Re: Pandas vs. Julia – cheat sheet and comparison
#79Earlier quoted context omitted.
For what it's worth this is literally how the Julia community deals with feedback.
Well it's not my website. Although the feedback does seem very "this toaster doesn't work when I try to cook soup in it! 1/5" Not everything needs to cater to mobile.
Nothing has to cater to anything but I'm still allowed to be annoyed that I can't read it on mobile.
Re: Pandas vs. Julia – cheat sheet and comparison
#80Yeah this is basically why I keep trying and bouncing off Julia. I understand the real performance reasons why you'd choose to use Julia but the syntax is the perfect distance from python to make it extremely difficult to me. It's just close enough to get constantly confused. So if I really wanted to do much work in it I'd have swear off python - and I can't do that because for trivial stuff python is more convenient…
I have not done anything even remotely significant in Julia, but the little I played with didn't seem to indicate to me that it would be bad for trivial stuff...what trivial stuff is hard in Julia but easy in Python?
>Julia
A = rand(Bool,3,3)
Python: No standard support for Matrices. I could really do it a disservsice and comapre the "core language", but that''s obivously stupid so we'll bring in some external libraries to make it easier. Of many ways to skin the cat here's one..>Python
import numpy.numpy as np
gen = np.random.default.default_rng()
B = gen.choice([True,False],(3,3))
I find myself just taking `rand(["Msg1",.....,"MsnN"])` to get a random string often.
And small things like this are why you see people Julia is so nice to write and become so defendant of it.