How to take a difference within the data of the same city but not across the city, Part 3

조회 수: 1 (최근 30일)
I have a table
City Date Cumulative_Visitors
-----------------------
NY January 1 100
NY January 2 150
NY January 3 200
SF January 1 70
SF January 2 200
SF January 3 400
I explained the problem of calculating the new_visitors.
If I just use "diff", then, it will create a problem at the first entry of each city.
Then the idea is
run diff
then replace the first entry of each city with the cumulative_visitor of that day
How can one write "replace the first entry of each city with the cumulative_visitor of that day"?
  댓글 수: 2
John D'Errico
John D'Errico 2020년 12월 8일
STOP ASKING THE SAME QUESTOIN REPEATEDLY. While you claim this is different, it is the same thing you asked before.
alpedhuez
alpedhuez 2020년 12월 8일
This is a "different way of solving the same question" that can be applied to other problems. Thus not redundant.

댓글을 달려면 로그인하십시오.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 12월 8일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Automated Driving Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by