forked from codebasics/py
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e7277f
commit 7b10130
Showing
1 changed file
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
""" | ||
Introducing pandas using namespace pd, | ||
such that you can call pandas class using pd instead of pandas. | ||
""" | ||
|
||
import pandas as pd | ||
|
||
# Dict object, with arbitrary data. | ||
stats = { | ||
'Month': ['Jan', 'Feb', 'March', 'April'], | ||
'Expenses': [2350, 3400, 2700, 2200], | ||
'Income': [4000, 4000, 4000, 4000] | ||
} | ||
|
||
# stats is now a pandas data frame object. | ||
df = pd.DataFrame(stats) | ||
# df = df.set_index('Month') | ||
print(df.Month) | ||
print(df.Month) |