2.41

陈元元發表於2024-10-08

import pandas as pd
import numpy as np
a = pd.DataFrame(np.random.randint(1,6,(5,3)),
index=['a', 'b', 'c', 'd', 'e'],
columns=['one', 'two', 'three'])
a.loc['a', 'one'] = np.nan
b = a.iloc[1:3, 0:2].values
a['four'] = 'bar'
a2 = a.reindex(['a', 'b', 'c', 'd', 'e', 'f'])
a3 = a2.dropna()