# A question about WeatherData and missing dates

**URL:** <https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103>\
**Category:** Questions\
**Tags:** data-science, curated-data, units\
**Created:** [May 21, 2023, 10:17am UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103 "2023-05-21T10:17:12Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliteimor](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aliteimor](https://community.wolfram.com/u/aliteimor)\
**Post date:** [May 21, 2023, 10:17am UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/1 "2023-05-21T10:17:12Z")

</div>

Dear All,

The year 2019 has 365 days.

The “WeatherData” output shows 357 data for Istanbul city.  
How do I use the Datepath command or any other commands to find the missing dates?

I appreciate your time.  
Alex

 ![4371Untitled.jpg](https://global.discourse-cdn.com/wolfram/original/2X/2/2b9e06b9e0d22604b458ca4f14201e94409cb7df.jpeg)

---

<div class="post-metadata">

**Author:** ![ghorbani](https://avatars.discourse-cdn.com/v4/letter/g/6a8cbe/32.png) [@ghorbani](https://community.wolfram.com/u/ghorbani)\
**Post date:** [May 21, 2023, 4:29pm UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/2 "2023-05-21T16:29:42Z")

</div>

Alex,

I had the same problem several times. Thank you for the inquiry.

Cheers,

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [May 21, 2023, 8:34pm UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/3 "2023-05-21T20:34:24Z")

</div>

Hello friends, here is one way:

```
{dateStart, dateEnd} = DateObject /@ {{2019, 1, 1, 0, 0, 0}, {2019, 12, 31, 0, 0, 0}};
data = WeatherData["Istambul", "WindSpeed", {dateStart, dateEnd, "Day"}];
allDays = DateRange[dateStart, dateEnd];
DateObject /@ Complement[DateString /@ allDays, DateString /@ data["Dates"]]

```

---

<div class="post-metadata">

**Author:** ![aliteimor](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aliteimor](https://community.wolfram.com/u/aliteimor)\
**Post date:** [May 22, 2023, 10:44am UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/4 "2023-05-22T10:44:39Z")

</div>

Hi Dr.Schachner,

That is a great solution. I found the missing dates easily. Thank you so much.

For filling up the missing dates, interpolating is a good way?  
Regards,

 ![Henrik.jpg](https://global.discourse-cdn.com/wolfram/original/3X/2/0/2078c839261e12fa0aca4f0814a3e9cd86ed9c90.jpeg)

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [May 22, 2023, 4:26pm UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/5 "2023-05-22T16:26:31Z")

</div>

Hi Henrik,

I was wondering why the conversion to `DateString` is required. Here is why

```
allDays[[1]] // InputForm
(* DateObject[{2019, 1, 1, 0, 0, 0.}, "Instant", "Gregorian", -5.] *)

data["Dates"][[1]] // InputForm
(* DateObject[{2019, 1, 1, 0, 0, 0}, "Instant", "Gregorian", -5.] *)

```

The `DateObject` generated by `DateRange` has `Real` seconds `0.` while the `DateObject` in `WeatherData` has `Integer` seconds `0`. Even though the date specifications passed to `DateRange` have `Integer` seconds. This seems like an oversight or bug in the implementation of `DateRange`. Thanks for revealing this, I will keep it in mind when dealing with `DateRange`.

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [May 22, 2023, 5:59pm UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/6 "2023-05-22T17:59:54Z")

</div>

Hi Rohit,

I freely admit that I could not make sense of why these `DateObject[]` do not work in combination with `Complement[]` - now I know, many thanks!

Regards – Henrik

---

<div class="post-metadata">

**Author:** ![henrikschachner](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/henrikschachner/32/32119_2.png) [@henrikschachner](https://community.wolfram.com/u/henrikschachner)\
**Post date:** [May 22, 2023, 6:08pm UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/7 "2023-05-22T18:08:29Z")

</div>

Hi Alex,

glad to help (and please just call me Henrik)! Yes, I think interpolation is a good way. And

```
data["PathFunction"]

```

gives already the respective `InterpolatingFunction`. Regards – Henrik

---

<div class="post-metadata">

**Author:** ![aliteimor](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aliteimor](https://community.wolfram.com/u/aliteimor)\
**Post date:** [May 23, 2023, 12:54pm UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/8 "2023-05-23T12:54:49Z")

</div>

I appreciate your help, Henrik.

I tried to fill in the missing data for 23rd January. I got a strange value!

It is the same for other dates.

```
In[16]:= data["PathFunction"];

In[15]:= %8[23]

Out[15]= Quantity[249937., ("Kilometers")/("Hours")]

```

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [May 23, 2023, 3:48pm UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/9 "2023-05-23T15:48:29Z")

</div>

Alex,

You need to pass an `AbsoluteTime` to the `PathFunction`.

```
data["PathFunction"][AbsoluteTime[{2019, 1, 23}]]
(* Quantity[13.52, ("Kilometers")/("Hours")] *)

```

---

<div class="post-metadata">

**Author:** ![aliteimor](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@aliteimor](https://community.wolfram.com/u/aliteimor)\
**Post date:** [May 24, 2023, 8:06am UTC](https://community.wolfram.com/t/a-question-about-weatherdata-and-missing-dates/22103/10 "2023-05-24T08:06:57Z")

</div>

Many thanks, Rohit.
