Skip to content

Commit d46b7d5

Browse files
author
Mofan Zhou
committedJul 4, 2016
create pd14
1 parent 39b393a commit d46b7d5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
 

‎numpy&pandas/14_nan.py

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# View more python tutorials on my Youtube and Youku channel!!!
2+
3+
# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
4+
# Youku video tutorial: http://i.youku.com/pythontutorial
5+
6+
7+
import pandas as pd
8+
import numpy as np
9+
10+
dates = pd.date_range('20130101', periods=6)
11+
df = pd.DataFrame(np.arange(24).reshape((6,4)), index=dates, columns=['A', 'B', 'C', 'D'])
12+
13+
df.iloc[0,1] = np.nan
14+
df.iloc[1,2] = np.nan
15+
print(df.dropna(axis=0, how='any')) # how={'any', 'all'}
16+
print(df.fillna(value=0))
17+
print(pd.isnull(df))

0 commit comments

Comments
 (0)
Please sign in to comment.