Skip to content

Commit 7b10130

Browse files
authored
1 parent 5e7277f commit 7b10130

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Modules/pandas_tutorial.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
"""
2+
Introducing pandas using namespace pd,
3+
such that you can call pandas class using pd instead of pandas.
4+
"""
5+
16
import pandas as pd
27

8+
# Dict object, with arbitrary data.
39
stats = {
410
'Month': ['Jan', 'Feb', 'March', 'April'],
511
'Expenses': [2350, 3400, 2700, 2200],
612
'Income': [4000, 4000, 4000, 4000]
713
}
814

15+
# stats is now a pandas data frame object.
916
df = pd.DataFrame(stats)
1017
# df = df.set_index('Month')
11-
print(df.Month)
18+
print(df.Month)

0 commit comments

Comments
 (0)