Earlier quoted context omitted.
Any examples? I've found Julia far easier for simple things than python. Most modern problems are mathematical and nature and I think it's pretty objective that julia looks closer to the mathematics. ----Some tests of very simple tasks in both languages. 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…
It’s funny that people used to get on Python’s case for not being object oriented enough, and now we’ve come around to folks thinking Python should just throw a function for everything into the default namespace …
Pandas vs. Julia – cheat sheet and comparison
101–110 of 138 posts
Re: Pandas vs. Julia – cheat sheet and comparison
#102The 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
Is that not also available in Pandas? https://pandas.pydata.org/docs/reference/api/pandas.DataFram...
Re: Pandas vs. Julia – cheat sheet and comparison
#103The 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
I'm still not entirely convinced that pipes aren't an anti-pattern. Absolutely an improvement over nested function calls: a(b(c(d))) vs d |> c |> b |> a but I'm not convinced pipes are better than more verbose code that explains each step: step1 = c(d) step2 = b(step1) result = a(step2) I've written a lot of tidy R and do understand the specific use cases where it really doesn't make sense to use the more verbose for…
Re: Pandas vs. Julia – cheat sheet and comparison
#104The 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.
Re: Pandas vs. Julia – cheat sheet and comparison
#105Earlier quoted context omitted.
> I'm not sure why this is the default behavior, Um. You said the answer earlier: > because the parser treats the literal as a double BigFloats aren't built in to the syntax of the language (and probably should't be, so you need to escape the parser somehow -- either pass a string to the constructor, or use the @big_str macro to get a non-standard string parsed into a BigFloat.
This makes perfect sense from the perspective of a language designer/computer scientist who is trying to keep their design clean and consistent. It makes no sense to an end user that expects an argument you pass to BigFloat to be treated as a BigFloat. As an end-user I would rather have a warning or even error than to have my argument silently treated as a double.
And this is not an advantage to the designer exclusively, it is very much an advantage for the end user that the treatment is explicit, consistent and predictable, instead of 'magically' reinterpreting the meaning of literals based on guessing the intent of the user.
Basically, you seem to be saying that when passing x to BigFloat, x should not be treated as the value x, but as some nearby value that might be the one the caller intended (based on some rounding logic perhaps?) Or are you perhaps saying that
x = 1e-300
y = BigFloat(x)
should be different from y = BigFloat(1e-300)
? In other words, completely discarding referential transparency?Re: Pandas vs. Julia – cheat sheet and comparison
#106The 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
Julia has a pipe syntax (|>). But I think the bigger part here is more generally APIs built around it, which people are doing some things to port tidy syntax ( https://github.com/TidierOrg/Tidier.jl ).
Re: Pandas vs. Julia – cheat sheet and comparison
#107Earlier quoted context omitted.
Any examples? I've found Julia far easier for simple things than python. Most modern problems are mathematical and nature and I think it's pretty objective that julia looks closer to the mathematics. ----Some tests of very simple tasks in both languages. 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…
> Sorry, I mean my np.somenamespace.another.namespace.sparce head :) I really don't understand what you are trying to complain about. Namespaces are nice. Dumping everything into the global namespace sucks.
Re: Pandas vs. Julia – cheat sheet and comparison
#108Earlier quoted context omitted.
This makes perfect sense from the perspective of a language designer/computer scientist who is trying to keep their design clean and consistent. It makes no sense to an end user that expects an argument you pass to BigFloat to be treated as a BigFloat. As an end-user I would rather have a warning or even error than to have my argument silently treated as a double.
The argument isn't silently treated as a double, it is explicitly and loudly treated as a double, because it is a literal double. And this is not an advantage to the designer exclusively, it is very much an advantage for the end user that the treatment is explicit, consistent and predictable, instead of 'magically' reinterpreting the meaning of literals based on guessing the intent of the user. Basically, you seem to…
Re: Pandas vs. Julia – cheat sheet and comparison
#109Earlier quoted context omitted.
I wish Python catches up to Julia in performance. No sense rewriting a trillion lines of code for what is a really pleasant syntax & ecosystem already. But this is a language flamewar thing, probably not a constructive comment, sorry.
You can just use Polars[0] instead of Pandas and easily beat both Pandas and DataFrames.jl Pure Julia is faster than pure python, but there are non-pure python tools available in the python ecosystem for a ton of things. [0] -- https://www.pola.rs/
Yes, I agree, on average polars is a bit faster for many of the simple workflows, but I certainly don't think that's unconditionally true. It's especially less true when you might want to do something out of the ordinary with your series --- in Julia it's trivial to just extract that as a vector and loop over it (fast!). In polars, one would have to make sure their function can be appropriately vectorized.
Re: Pandas vs. Julia – cheat sheet and comparison
#110Earlier quoted context omitted.
The argument isn't silently treated as a double, it is explicitly and loudly treated as a double, because it is a literal double. And this is not an advantage to the designer exclusively, it is very much an advantage for the end user that the treatment is explicit, consistent and predictable, instead of 'magically' reinterpreting the meaning of literals based on guessing the intent of the user. Basically, you seem to…
I think the argument here is that parsing of the string '1e-300' maybe should be context dependent. In this case, 1e-300 is being parsed as a double, and then forwarded to the function. Maybe it could be parsed as a bigfloat whenever it is an argument of a function expecting a bigfloat.
I think it was a mistake. Invariably, a new user discovers the discrepancy and is thoroughly confused. Let's not repeat the same mistake with big nums.