# OnlineStats at Series how to get numer of case? s.n , n(s) not works

**URL:** https://discourse.julialang.org/t/onlinestats-at-series-how-to-get-numer-of-case-s-n-n-s-not-works/34913
**Category:** General Usage
**Created:** [February 20, 2020, 4:29pm UTC](https://discourse.julialang.org/t/onlinestats-at-series-how-to-get-numer-of-case-s-n-n-s-not-works/34913 "2020-02-20T16:29:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![programista](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/programista/32/5372_2.png) [@programista](https://discourse.julialang.org/u/programista)
#### Post date: [February 20, 2020, 4:29pm UTC](https://discourse.julialang.org/t/onlinestats-at-series-how-to-get-numer-of-case-s-n-n-s-not-works/34913/1 "2020-02-20T16:29:21Z")

</div>

using OnlineStats, Distributed  
julia\> s = @distributed merge for i in 1:3  
fit!(Series(Mean()), randn(10\_000))  
end  
Series  
└── Mean: n=30000 | value=0.0018463  
julia\> s.stats  
(Mean: n=30000 | value=0.00170161,)

julia\> value(s)  
(0.0017016120916806031,)

julia\> n(s)

```julia
ERROR: UndefVarError: n not defined
Stacktrace:
 [1] top-level scope at none:0

julia> s.n
ERROR: type Series has no field n
Stacktrace:
 [1] getproperty(::Any, ::Symbol) at .\sysimg.jl:18

```

Paul

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [February 20, 2020, 4:40pm UTC](https://discourse.julialang.org/t/onlinestats-at-series-how-to-get-numer-of-case-s-n-n-s-not-works/34913/2 "2020-02-20T16:40:06Z")

</div>

```julia
s.stats[1].n

```

(you can work this out by doing `fieldnames(typeof(s.stats))` and then `fieldnames(typeof(s.stats[1]))` once you’ve found out that the field of `s.stats` is called `1`)

---

<div class="post-metadata">

### Author: ![joshday](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joshday/32/368_2.png) [@joshday](https://discourse.julialang.org/u/joshday)
#### Post date: [February 20, 2020, 4:45pm UTC](https://discourse.julialang.org/t/onlinestats-at-series-how-to-get-numer-of-case-s-n-n-s-not-works/34913/3 "2020-02-20T16:45:15Z")

</div>

You can use `nobs(s)`.
