I appreciate all the help in this thread, thank you, everyone.
I think pdeffebach’s MWE was not what I wanted, though.
I think nilshg’s MWE was close to what I want.
Here is the current codes, using bits from both MWEs.
The current problem is that the data has reverse chronic order, so that I need to sort the data by country and by day.
However, the sort() function does not understand that “1/10/2020” is after “1/9/2020”.
julia> @time using CSV, DataFrames, Dates
0.000855 seconds (1.14 k allocations: 60.422 KiB)
julia> @time df = CSV.File("/home/c/Downloads/COVID-19-geographic-disbtribution-worldwide-2020-06-24.csv") |> DataFrame
0.058011 seconds (148.06 k allocations: 7.819 MiB)
julia> @time transform(groupby(df, :countriesAndTerritories), :deaths => cumsum => :deaths)
0.168699 seconds (211.01 k allocations: 10.525 MiB, 21.53% gc time)
julia> sort!(df, (order(:countriesAndTerritories), order(:dateRep)))
┌ Warning: Passing a tuple (DataFrames.UserColOrdering{Symbol}(:countriesAndTerritories, Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()), DataFrames.UserColOrdering{Symbol}(:dateRep, Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}())) of column selectors when sorting data frame is deprecated. Pass a vector DataFrames.UserColOrdering{Symbol}[DataFrames.UserColOrdering{Symbol}(:countriesAndTerritories, Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}()), DataFrames.UserColOrdering{Symbol}(:dateRep, Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}())] instead.
│ caller = sort!(::DataFrame, ::Tuple{DataFrames.UserColOrdering{Symbol},DataFrames.UserColOrdering{Symbol}}; alg::Nothing, lt::Function, by::Function, rev::Bool, order::Base.Order.ForwardOrdering) at sort.jl:83
└ @ DataFrames ~/.julia/packages/DataFrames/e3P4n/src/dataframe/sort.jl:83
25517×11 DataFrame. Omitted printing of 1 columns
│ Row │ dateRep │ day │ month │ year │ cases │ deaths │ countriesAndTerritories │ geoId │ countryterritoryCode │ popData2019 │
│ │ String │ Int64 │ Int64 │ Int64 │ Int64 │ Int64 │ String │ String │ String? │ Int64? │
├───────┼───────────┼───────┼───────┼───────┼───────┼────────┼─────────────────────────┼────────┼──────────────────────┼─────────────┤
│ 1 │ 1/1/2020 │ 1 │ 1 │ 2020 │ 0 │ 0 │ Afghanistan │ AF │ AFG │ 38041757 │
│ 2 │ 1/10/2020 │ 10 │ 1 │ 2020 │ 0 │ 0 │ Afghanistan │ AF │ AFG │ 38041757 │
│ 3 │ 1/11/2020 │ 11 │ 1 │ 2020 │ 0 │ 0 │ Afghanistan │ AF │ AFG │ 38041757 │
│ 4 │ 1/12/2020 │ 12 │ 1 │ 2020 │ 0 │ 0 │ Afghanistan │ AF │ AFG │ 38041757 │
│ 5 │ 1/13/2020 │ 13 │ 1 │ 2020 │ 0 │ 0 │ Afghanistan │ AF │ AFG │ 38041757 │
│ 6 │ 1/14/2020 │ 14 │ 1 │ 2020 │ 0 │ 0 │ Afghanistan │ AF │ AFG │ 38041757 │