pandas

function interpretation
pd.Series(list of values) creste a list with default integer index, you can access value by using s[index]
pd.read_csv("name of csv")
pd.concat((df1, df3), axis= ,join = "" sort) concatenate dataframes
df = pd.DataFrame()
df.info()
df.index *no brackets, return a list of index
df.empty return a boolean, True if empty
df.ndim return dimension count
df.shape
df.size get count of elements
df.at([index, column]) access single element
df.reset_index()
df.append() smilar to pd.concat
df.query('condition') such as 'a>100 and 'b<20'
df.to_html()
df.max() default axis=0, return maximum of every column
df.max().max() maximum of the table
df.mean()
df.mean().mean()
df.fillna()
df.axes axes info
df.columns columns name, can be rewriten
df.dtype
df.iterrows() iterate over rows
df.rename() rename the column name
df.select_dtype(include='typename') select data by datatype
df.sort_values() sort by column name
df.sort_index() sort by index
df.drop() delete columns
df.set_index() set certain column as index
df.reindex() change order of columns
df.replace() replace values
df.loc()/df.iloc()
df.append() add rows
df.head() get first n rows
df.to_numpy() to numpy array
原文地址:https://www.cnblogs.com/ashyLoveLoli/p/15204564.html