Para calcular la integral definida usando esa función, tenemos que definir algo parecido a linspace:
def linspace(start,stop,count):
return [x*(stop-start)/(count-1)+start for x in range(0,count)]
from math import pi, sin
x = linspace(0,pi,7)
y = [sin(y) for y in x]
print(simp_int(x,y))
El resultado es 2.0008631896735363, un 0.04% más que el valor real.
Anyone doing #AdventOfCode ? I start with the best of intentions but have never finished it. Last year, I did it in #Julia. I was thinking I would try it again but then I thought perhaps I should go for it in #CSharp. I've been doing a lot of work in C# and I have been enjoying it and need to get better at it. Any other language you would suggest? I only have 2 requirements - it must have threading baked in and it has to have an easy way to pull stuff from the Internet.
For the first day of #AdventOfCode living in UTC+0, I actually have to be up at stupid o'clock anyway. In the interests of speed, which I usually do not care about, given the opportunity I shall start day 1 in #perl in which the thing will take moments. I'll clean it up into #raku because, well, one ought to. I'll then start again in #Julia because that's what I want to learn this time around.
I see a lot of exotic things, or rust, or R. Where's my perl tribesfolk?!
Here‘s another interesting #julialang, #python, #rstats comparison: „count the number of vowels in a string“. #julia uses an anonymous function as an argument to count(), #python iterates over the string using list comprehension, #rstats does the same but in a vectorized way
I'm thinking about porting functionality in the {stats19} #rstats package into #Python and possibly other languages. Are you an #OpenSource developer with an interest in #DataScience for policy, sustainability + good? If so please check this issue and let us know your thoughts on taking this project to the next level 🚀 https://github.com/ropensci/stats19/issues/230 @rOpenSci@mszll + all any thoughts on best practices welcome also 🙏
"Great language" is merely a subjective statement. #R has long dropped outside the top 20 of the most used languages in the world and the trend only points downwards. It is in the bottom half of #StackOverflow 's admiration ranking and scores less than 4% in the desirable ranking. In contrast, recent languages like #Flow, #Julia, #Mojo, etc yield pretty much the opposite dynamics at the moment.
Various thoughts on too many programming languages, for no discernible reason.
I have been interested in Go since it's very initial release, but their dependence on Google is uncharming to say the least. I still haven't made up my mind on its GC, but its definitely better than most.
I used to do some ML work in .NET and if it wasn't dependent on Microsoft it would be a heavy contender for a great language, but it has far too many Microsoft-isms to ever really go much farther.
Rust is great, I enjoy beating my head against a brick wall battling with the compiler, and their safety is great, but overly complicated and feature-creep is a real problem on that entire project. I do a lot of work these days in Rust, for better (mostly) or worse (mostly-ish).
C is my bread-and-butter, as is Javascript for quick prototyping.
Elixir is great, but Erlang is unwieldy, the community is growing, but not fast enough - and I just can't get my mind to enjoy the syntax no matter how nice it is.
D is a lot of fun, but their GC can be slow at times, and the community is very small and packages are often broken and unmaintained.
Python was my first true love, but I really can't stand the whitespace, again love the language, hate the syntax.
Zig is fun, but just that. Fast, nimble, but early days, a bit confusing, could replace my insistence on C for core projects, but again, early days. I love to use them as a compiler for C, much faster than the defaults on any of the others.
Odin is one I love to keep an eye on, I wish I could get behind using it for more things. When I first took notice ~4 years ago the documentation was a bit scattered, but it looks much better now. The developer behind it is incredibly cool, could be seen as the next Dennis Ritchie imo. Runes are dope. The syntax is by far my favourite.
Julia, I love Julia, but performance last I tested was a bit of a miss, and by miss, it required a decent chunk of compute for basics, but when you gave it the system to throttle, it would be insanely productive to write in. Javascript is something that I prototype even syscalls in, but Julia is just the same but much better and more productive (and less strange) in many regards. I am really hoping this takes over in the ML/Data world and just eats Python alive. I've heard there has been major work in the perf department, but I haven't had reason to try it out lately.
Ada, memory safety before Rust! Great language, especially for critical applications, decades of baggage (or wisdom), slow moving language, insanely stable, compilers are all mostly proprietary, job market is small, but well paid, great for robotics, defense, and space industry types, but the syntax is... rough. Someone should make a meta-language on top of Ada like Zig/Nim/Odin do for C, or Elixir does for Erlang.
The others: Carbon, haven't tried; Nim, prefer when they were "Nimrod" (cue Green Day), decent but not my style; Crystal, seems cool, but not for me; Scala, great FP language, but JVM; Haskell, I'm not a mathematician, but my mathematician friends love it. I see why, but not my thing as much as I love functional languages. I'll try it again, eventually. I did not learn Haskell a great good.
I tend to jump from language to language, trying everything out, it's fun and a total timesuck.
I know you have plotnine in #python as a grammar of graphics implementation, but its' not even close to ggplot2. There's the siuba package as well, but also that is far less extensive (kudos to Michael Chow though, it's a great effort). https://github.com/machow/siuba
Other "new" nice renderings of the growth of simulated clusters of galaxies by my former student Matteo Angelinelli, who kindly left all these gems in an hard disc!
@r_ivorra
Yes, #Fortran stands for "Formula Translator". It is still one of the major language in the scientific field. But #Python has also been adopted a lot for computation (often using Fortran libraries) on the desktop. #Matlab is also using a lot of Fortran libraries. And there are also #C++ and #Julia.
Being a compiled language, Fortran programs can run fast, as C and C++.
For example, many climate models are written in Fortran or use Fortran libraries.
Hey everyone, I just made something cool!
I wrote a fractal viewer in C++, compiled it to #Wasm using #Emscripten, and put it on my website (https://kalankaboom.net/).
I wrote an article on how I made it, and I would love for you to check it out and give me all the feedback you can!