Arrays: Slices and Views | Week 2, lecture 8 | 18.S191 MIT Fall 2020

Поделиться
HTML-код
  • Опубликовано: 7 ноя 2024

Комментарии • 10

  • @mailsiraj
    @mailsiraj Год назад

    wow - Julia makes these 2 types of slices very explicit - very user-friendly for new programmers.

  • @rhonaw3409
    @rhonaw3409 4 года назад +6

    Really enjoyed this lecture! One request though... Could you please move your microphone for your next recording? It's picking up a lot of noise from keystrokes and mouse movements as low thumping noises throughout, making it quite uncomfortable listening on headphones!

  • @prietjepruck
    @prietjepruck Год назад

    Nice tutorial, thanks for your help.

  • @julesjacobs1
    @julesjacobs1 4 года назад +7

    Your voice is so good.

  • @qubitnerd7115
    @qubitnerd7115 4 года назад +2

    To be fair .. it doesnt exactly create a copy of the data ,
    go try this out in your REPL ...
    julia> A = [ [1,2] , [2,3] , [3,4] , [4,5] , [5,6] ]
    julia> B = A[1:3] # select over elements 1-3 to B
    julia> B[1][1] = 100000 # modify the first element of the first element in B
    julia> println(A)
    i dont mean to pedantic but when you are a beginner i think this is an important difference to know or might eventually bite you someday , look up on immutable and mutable data types .

    • @AhmedIsam
      @AhmedIsam 3 года назад +1

      A is changed as expected. What's your message?

  • @ruibinliu6857
    @ruibinliu6857 3 года назад +1

    If you type v[3:5] .= 9, the 3rd to 5th elements of v will change to 9 too. Is the 'view' function necessary?

  • @jling0
    @jling0 4 года назад

    It's all natural now but sometimes people get an impression @view -> view(only) -> no allocation but also cannot change

  • @Antcap96
    @Antcap96 4 года назад +4

    This notebook would make more sense as a jupyter notebook than a pluto notebook

    • @ilyaorsonsandoval4670
      @ilyaorsonsandoval4670 4 года назад +1

      Its a different notebook focusing on reactivity (based on observablehq: observablehq.com/@observablehq/observable-for-jupyter-users). A great trade-off for teaching imho, no student should care about rerunning a notebook in the "right" order.