Iterating over time series2019 Community Moderator ElectionCalculate relative time in C#How do I iterate over a range of numbers defined by variables in Bash?How to get the current time in PythonWhy is using “for…in” with array iteration a bad idea?How can I make a time delay in Python?What do 'real', 'user' and 'sys' mean in the output of time(1)?A 'for' loop to iterate over an enum in JavaIterating over dictionaries using 'for' loopsHow to iterate over rows in a DataFrame in Pandas?Why are some float < integer comparisons four times slower than others?

Automaton recognizing ambiguously accepted words of another automaton

Are all players supposed to be able to see each others' character sheets?

ESPP--any reason not to go all in?

What is this tube in a jet engine's air intake?

How can I portion out frozen cookie dough?

When an outsider describes family relationships, which point of view are they using?

Has a sovereign Communist government ever run, and conceded loss, on a fair election?

Short scifi story where reproductive organs are converted to produce "materials", pregnant protagonist is "found fit" to be a mother

Smooth vector fields on a surface modulo diffeomorphisms

Cycles on the torus

Would those living in a "perfect society" not understand satire

PTIJ: Sport in the Torah

I am the person who abides by rules, but breaks the rules. Who am I?

Do black holes violate the conservation of mass?

Use Mercury as quenching liquid for swords?

Difference between `nmap local-IP-address` and `nmap localhost`

What does the Digital Threat scope actually do?

-1 to the power of a irrational number

What can I do if someone tampers with my SSH public key?

Too soon for a plot twist?

How to educate team mate to take screenshots for bugs with out unwanted stuff

Did Amazon pay $0 in taxes last year?

"If + would" conditional in present perfect tense

Does an unused member variable take up memory?



Iterating over time series



2019 Community Moderator ElectionCalculate relative time in C#How do I iterate over a range of numbers defined by variables in Bash?How to get the current time in PythonWhy is using “for…in” with array iteration a bad idea?How can I make a time delay in Python?What do 'real', 'user' and 'sys' mean in the output of time(1)?A 'for' loop to iterate over an enum in JavaIterating over dictionaries using 'for' loopsHow to iterate over rows in a DataFrame in Pandas?Why are some float < integer comparisons four times slower than others?










2















The following is a sample of my dataset:





index time speed
0 00:00:00 15
1 00:00:05 18
2 00:00:10 23
3 00:00:15 25
4 00:00:20 34


I would like to create a for loop that does the same function as below:





for i in range (0,5,1):
if df.speed[i] > df.speed [i+2]:
print ('Larger')
else:
print('Smaller')


However, I would like to refer to time instead of indices in the FOR loop. For example:





for t in range (00:00:00, 00:00:20 , 5s):
if df.speed[t] > df.speed [t+10s]:
print ('Larger')
else:
print('Smaller')


So the FOR LOOP will take the speed value at a certain t and compare with it the value of the speed after 10 seconds. If it is larger, then it prints Larger, otherwise, Smaller.



I appreciate any help. Thanks.










share|improve this question









New contributor




Alex Davies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    2















    The following is a sample of my dataset:





    index time speed
    0 00:00:00 15
    1 00:00:05 18
    2 00:00:10 23
    3 00:00:15 25
    4 00:00:20 34


    I would like to create a for loop that does the same function as below:





    for i in range (0,5,1):
    if df.speed[i] > df.speed [i+2]:
    print ('Larger')
    else:
    print('Smaller')


    However, I would like to refer to time instead of indices in the FOR loop. For example:





    for t in range (00:00:00, 00:00:20 , 5s):
    if df.speed[t] > df.speed [t+10s]:
    print ('Larger')
    else:
    print('Smaller')


    So the FOR LOOP will take the speed value at a certain t and compare with it the value of the speed after 10 seconds. If it is larger, then it prints Larger, otherwise, Smaller.



    I appreciate any help. Thanks.










    share|improve this question









    New contributor




    Alex Davies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      2












      2








      2








      The following is a sample of my dataset:





      index time speed
      0 00:00:00 15
      1 00:00:05 18
      2 00:00:10 23
      3 00:00:15 25
      4 00:00:20 34


      I would like to create a for loop that does the same function as below:





      for i in range (0,5,1):
      if df.speed[i] > df.speed [i+2]:
      print ('Larger')
      else:
      print('Smaller')


      However, I would like to refer to time instead of indices in the FOR loop. For example:





      for t in range (00:00:00, 00:00:20 , 5s):
      if df.speed[t] > df.speed [t+10s]:
      print ('Larger')
      else:
      print('Smaller')


      So the FOR LOOP will take the speed value at a certain t and compare with it the value of the speed after 10 seconds. If it is larger, then it prints Larger, otherwise, Smaller.



      I appreciate any help. Thanks.










      share|improve this question









      New contributor




      Alex Davies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      The following is a sample of my dataset:





      index time speed
      0 00:00:00 15
      1 00:00:05 18
      2 00:00:10 23
      3 00:00:15 25
      4 00:00:20 34


      I would like to create a for loop that does the same function as below:





      for i in range (0,5,1):
      if df.speed[i] > df.speed [i+2]:
      print ('Larger')
      else:
      print('Smaller')


      However, I would like to refer to time instead of indices in the FOR loop. For example:





      for t in range (00:00:00, 00:00:20 , 5s):
      if df.speed[t] > df.speed [t+10s]:
      print ('Larger')
      else:
      print('Smaller')


      So the FOR LOOP will take the speed value at a certain t and compare with it the value of the speed after 10 seconds. If it is larger, then it prints Larger, otherwise, Smaller.



      I appreciate any help. Thanks.







      python for-loop if-statement time jupyter






      share|improve this question









      New contributor




      Alex Davies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Alex Davies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 4 hours ago







      Alex Davies













      New contributor




      Alex Davies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Mar 6 at 21:30









      Alex DaviesAlex Davies

      235




      235




      New contributor




      Alex Davies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Alex Davies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Alex Davies is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          1














          Date Range (Seconds)



          It seems you're using pandas. If that's so, you really should look at it's Time Series features: https://pandas.pydata.org/pandas-docs/stable/timeseries.html



          More specific, at pandas.date_range():



          import pandas as pd

          pd.date_range('00:00:00', '00:00:20', freq='5s')


          Since it's a date range function, it'll return datetimes



          DatetimeIndex(['2019-03-06 00:00:00',
          '2019-03-06 00:00:05',
          ...,
          '2019-03-06 00:00:20'], dtype='datetime64[ns]', freq='5S')


          From here just use .strftime() to get what you want:



          pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S')



          Returns



          Index(['00:00:00', '00:00:05', ..., '00:00:20'], dtype='object')




          Access dataframe by time



          After that, in order to access your dataframe using this index you have two options:



          1. Using .loc to find the row where this time is:

          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.loc[df['time'] == time, 'speed'] ..):


          1. By redefining the dataframe index with set_index(), and then accessing it directly by time:

          df.set_index('time', inplace=True)
          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.speed[time] ...):



          Edit to address comment question



          After you you use strftime() it is converted to a String. You could convert it back to add the 10 seconds like:



          df.speed[(pd.to_datetime(time) + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')].



          Or:



          for time in pd.date_range('00:00:00', '00:00:20', freq='5s'):
          if (df.speed[time.strftime('%H:%M:%S')]>df.speed[(time + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')]):





          share|improve this answer










          New contributor




          jmiguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • Thanks for your answer. However, there is one more point I would like to know for the if condition how to add or remove seconds on the time. for example: if (df.speed[time]>df.speed[time+ 10]) or should it be (+00:00:10), or (+'10s')?

            – Alex Davies
            2 days ago







          • 1





            Added an edit to address this.

            – jmiguel
            2 days ago










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Alex Davies is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032453%2fiterating-over-time-series%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Date Range (Seconds)



          It seems you're using pandas. If that's so, you really should look at it's Time Series features: https://pandas.pydata.org/pandas-docs/stable/timeseries.html



          More specific, at pandas.date_range():



          import pandas as pd

          pd.date_range('00:00:00', '00:00:20', freq='5s')


          Since it's a date range function, it'll return datetimes



          DatetimeIndex(['2019-03-06 00:00:00',
          '2019-03-06 00:00:05',
          ...,
          '2019-03-06 00:00:20'], dtype='datetime64[ns]', freq='5S')


          From here just use .strftime() to get what you want:



          pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S')



          Returns



          Index(['00:00:00', '00:00:05', ..., '00:00:20'], dtype='object')




          Access dataframe by time



          After that, in order to access your dataframe using this index you have two options:



          1. Using .loc to find the row where this time is:

          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.loc[df['time'] == time, 'speed'] ..):


          1. By redefining the dataframe index with set_index(), and then accessing it directly by time:

          df.set_index('time', inplace=True)
          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.speed[time] ...):



          Edit to address comment question



          After you you use strftime() it is converted to a String. You could convert it back to add the 10 seconds like:



          df.speed[(pd.to_datetime(time) + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')].



          Or:



          for time in pd.date_range('00:00:00', '00:00:20', freq='5s'):
          if (df.speed[time.strftime('%H:%M:%S')]>df.speed[(time + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')]):





          share|improve this answer










          New contributor




          jmiguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • Thanks for your answer. However, there is one more point I would like to know for the if condition how to add or remove seconds on the time. for example: if (df.speed[time]>df.speed[time+ 10]) or should it be (+00:00:10), or (+'10s')?

            – Alex Davies
            2 days ago







          • 1





            Added an edit to address this.

            – jmiguel
            2 days ago















          1














          Date Range (Seconds)



          It seems you're using pandas. If that's so, you really should look at it's Time Series features: https://pandas.pydata.org/pandas-docs/stable/timeseries.html



          More specific, at pandas.date_range():



          import pandas as pd

          pd.date_range('00:00:00', '00:00:20', freq='5s')


          Since it's a date range function, it'll return datetimes



          DatetimeIndex(['2019-03-06 00:00:00',
          '2019-03-06 00:00:05',
          ...,
          '2019-03-06 00:00:20'], dtype='datetime64[ns]', freq='5S')


          From here just use .strftime() to get what you want:



          pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S')



          Returns



          Index(['00:00:00', '00:00:05', ..., '00:00:20'], dtype='object')




          Access dataframe by time



          After that, in order to access your dataframe using this index you have two options:



          1. Using .loc to find the row where this time is:

          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.loc[df['time'] == time, 'speed'] ..):


          1. By redefining the dataframe index with set_index(), and then accessing it directly by time:

          df.set_index('time', inplace=True)
          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.speed[time] ...):



          Edit to address comment question



          After you you use strftime() it is converted to a String. You could convert it back to add the 10 seconds like:



          df.speed[(pd.to_datetime(time) + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')].



          Or:



          for time in pd.date_range('00:00:00', '00:00:20', freq='5s'):
          if (df.speed[time.strftime('%H:%M:%S')]>df.speed[(time + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')]):





          share|improve this answer










          New contributor




          jmiguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















          • Thanks for your answer. However, there is one more point I would like to know for the if condition how to add or remove seconds on the time. for example: if (df.speed[time]>df.speed[time+ 10]) or should it be (+00:00:10), or (+'10s')?

            – Alex Davies
            2 days ago







          • 1





            Added an edit to address this.

            – jmiguel
            2 days ago













          1












          1








          1







          Date Range (Seconds)



          It seems you're using pandas. If that's so, you really should look at it's Time Series features: https://pandas.pydata.org/pandas-docs/stable/timeseries.html



          More specific, at pandas.date_range():



          import pandas as pd

          pd.date_range('00:00:00', '00:00:20', freq='5s')


          Since it's a date range function, it'll return datetimes



          DatetimeIndex(['2019-03-06 00:00:00',
          '2019-03-06 00:00:05',
          ...,
          '2019-03-06 00:00:20'], dtype='datetime64[ns]', freq='5S')


          From here just use .strftime() to get what you want:



          pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S')



          Returns



          Index(['00:00:00', '00:00:05', ..., '00:00:20'], dtype='object')




          Access dataframe by time



          After that, in order to access your dataframe using this index you have two options:



          1. Using .loc to find the row where this time is:

          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.loc[df['time'] == time, 'speed'] ..):


          1. By redefining the dataframe index with set_index(), and then accessing it directly by time:

          df.set_index('time', inplace=True)
          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.speed[time] ...):



          Edit to address comment question



          After you you use strftime() it is converted to a String. You could convert it back to add the 10 seconds like:



          df.speed[(pd.to_datetime(time) + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')].



          Or:



          for time in pd.date_range('00:00:00', '00:00:20', freq='5s'):
          if (df.speed[time.strftime('%H:%M:%S')]>df.speed[(time + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')]):





          share|improve this answer










          New contributor




          jmiguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










          Date Range (Seconds)



          It seems you're using pandas. If that's so, you really should look at it's Time Series features: https://pandas.pydata.org/pandas-docs/stable/timeseries.html



          More specific, at pandas.date_range():



          import pandas as pd

          pd.date_range('00:00:00', '00:00:20', freq='5s')


          Since it's a date range function, it'll return datetimes



          DatetimeIndex(['2019-03-06 00:00:00',
          '2019-03-06 00:00:05',
          ...,
          '2019-03-06 00:00:20'], dtype='datetime64[ns]', freq='5S')


          From here just use .strftime() to get what you want:



          pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S')



          Returns



          Index(['00:00:00', '00:00:05', ..., '00:00:20'], dtype='object')




          Access dataframe by time



          After that, in order to access your dataframe using this index you have two options:



          1. Using .loc to find the row where this time is:

          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.loc[df['time'] == time, 'speed'] ..):


          1. By redefining the dataframe index with set_index(), and then accessing it directly by time:

          df.set_index('time', inplace=True)
          for time in pd.date_range('00:00:00', '00:00:20', freq='5s').strftime('%H:%M:%S'):
          if (df.speed[time] ...):



          Edit to address comment question



          After you you use strftime() it is converted to a String. You could convert it back to add the 10 seconds like:



          df.speed[(pd.to_datetime(time) + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')].



          Or:



          for time in pd.date_range('00:00:00', '00:00:20', freq='5s'):
          if (df.speed[time.strftime('%H:%M:%S')]>df.speed[(time + pd.to_timedelta(10, unit='s')).strftime('%H:%M:%S')]):






          share|improve this answer










          New contributor




          jmiguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer








          edited 2 days ago





















          New contributor




          jmiguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered 2 days ago









          jmigueljmiguel

          1663




          1663




          New contributor




          jmiguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          jmiguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          jmiguel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.












          • Thanks for your answer. However, there is one more point I would like to know for the if condition how to add or remove seconds on the time. for example: if (df.speed[time]>df.speed[time+ 10]) or should it be (+00:00:10), or (+'10s')?

            – Alex Davies
            2 days ago







          • 1





            Added an edit to address this.

            – jmiguel
            2 days ago

















          • Thanks for your answer. However, there is one more point I would like to know for the if condition how to add or remove seconds on the time. for example: if (df.speed[time]>df.speed[time+ 10]) or should it be (+00:00:10), or (+'10s')?

            – Alex Davies
            2 days ago







          • 1





            Added an edit to address this.

            – jmiguel
            2 days ago
















          Thanks for your answer. However, there is one more point I would like to know for the if condition how to add or remove seconds on the time. for example: if (df.speed[time]>df.speed[time+ 10]) or should it be (+00:00:10), or (+'10s')?

          – Alex Davies
          2 days ago






          Thanks for your answer. However, there is one more point I would like to know for the if condition how to add or remove seconds on the time. for example: if (df.speed[time]>df.speed[time+ 10]) or should it be (+00:00:10), or (+'10s')?

          – Alex Davies
          2 days ago





          1




          1





          Added an edit to address this.

          – jmiguel
          2 days ago





          Added an edit to address this.

          – jmiguel
          2 days ago












          Alex Davies is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Alex Davies is a new contributor. Be nice, and check out our Code of Conduct.












          Alex Davies is a new contributor. Be nice, and check out our Code of Conduct.











          Alex Davies is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55032453%2fiterating-over-time-series%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

          Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

          How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page