Skip to content

Commit b726b19

Browse files
committed
Adding docs for basic usage
1 parent 89a2c38 commit b726b19

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/pandas_types.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
The `Series` class provides support for working with pandas Series objects.
3+
4+
```py
5+
import pandas as pd
6+
from pydantic import BaseModel
7+
8+
from pydantic_extra_types.pandas_types import Series
9+
10+
11+
class MyData(BaseModel):
12+
numbers: Series[int]
13+
14+
15+
data = {"numbers": pd.Series([1, 2, 3, 4, 5])}
16+
my_data = MyData(**data)
17+
18+
print(my_data.numbers)
19+
# > 0 1
20+
# > 1 2
21+
# > 2 3
22+
# > 3 4
23+
# > 4 5
24+
# > dtype: int64

0 commit comments

Comments
 (0)