Add source example files
This commit is contained in:
14
source/pandas/01-pandas-manual/05-series-index.py
Normal file
14
source/pandas/01-pandas-manual/05-series-index.py
Normal file
@ -0,0 +1,14 @@
|
||||
import pandas as pd
|
||||
|
||||
if __name__ == '__main__':
|
||||
df = pd.Series([1, 3, 2, 4, 2, 2, 2, 1, 1, 3])
|
||||
# Add an index to the series, that could be used to make a
|
||||
# temporal series.
|
||||
df.index = pd.Series([2, 3, 4, 5, 6, 7, 8, 9, 10, 11])
|
||||
print(df)
|
||||
|
||||
|
||||
s = pd.Series([2, 5, 2, 6], index=pd.date_range("2023-01-01", "2023-01-10", 4))
|
||||
print(s)
|
||||
dr = pd.date_range("2023-01-01", "2023-01-10", 4)
|
||||
print(dr)
|
Reference in New Issue
Block a user