MOST USED FUNCTIONS IN PANDAS
MOST USED FUNCTIONS IN PANDAS
read_csv(): reads a CSV file into a DataFrame.
- read_excel(): reads an Excel file into a DataFrame.
- read_sql(): reads a SQL query or database table into a DataFrame.
- read_json(): reads a JSON file into a DataFrame.
- read_html(): reads an HTML file or URL into a list of DataFrames.
- read_stata(): reads a Stata file into a DataFrame.
- read_clipboard(): reads text from the clipboard into a DataFrame.
- read_pickle(): reads a pickled object into a DataFrame.
- read_feather(): reads a Feather file into a DataFrame.
- read_parquet(): reads a Parquet file into a DataFrame.
- read_hdf(): reads an HDF5 file into a DataFrame.
- DataFrame(): creates a new DataFrame object.
- Series(): creates a new Series object.
- concat(): concatenates two or more DataFrames.
- merge(): merges two DataFrames based on a common column.
- append(): appends rows to a DataFrame.
- pivot_table(): creates a pivot table from a DataFrame.
- groupby(): groups data by one or more columns.
- apply(): applies a function to each element of a DataFrame or Series.
- transform(): applies a function to each group in a groupby object.
- agg(): aggregates data in a groupby object.
- rolling(): calculates a rolling window function on a DataFrame or Series.
- resample(): resamples a time-series DataFrame.
- mean(): calculates the mean of a DataFrame or Series.
- median(): calculates the median of a DataFrame or Series.
- mode(): calculates the mode of a DataFrame or Series.
- min(): calculates the minimum of a DataFrame or Series.
- max(): calculates the maximum of a DataFrame or Series.
- std(): calculates the standard deviation of a DataFrame or Series.
- sum(): calculates the sum of a DataFrame or Series.
- abs(): calculates the absolute value of a DataFrame or Series.
- round(): rounds the values of a DataFrame or Series.
- clip(): clips the values of a DataFrame or Series.
- isna(): returns a boolean mask indicating missing values.
- notna(): returns a boolean mask indicating non-missing values.
- dropna(): drops missing values from a DataFrame or Series.
- fillna(): fills missing values in a DataFrame or Series.
- replace(): replaces values in a DataFrame or Series.
- map(): maps values in a Series to new values.
- applymap(): applies a function to each element of a DataFrame.
- select_dtypes(): selects columns based on their data type.
- loc(): accesses a group of rows and columns by label.
- iloc(): accesses a group of rows and columns by integer position.
- at(): accesses a single value by label.
- iat(): accesses a single value by integer position.
- query(): selects rows based on a boolean expression.
- sort_values(): sorts a DataFrame by one or more columns.
- sort_index(): sorts a DataFrame by its index.
- nlargest(): returns the n largest values in a DataFrame or Series.
- nsmallest(): returns the n smallest values in a DataFrame or Series.
- pivot(): reshapes a DataFrame from long to wide format.
- melt(): reshapes a DataFrame from wide to long format.
- explode(): returns a new DataFrame with each element of a column in a new row.
- reset_index(): resets the index of a DataFrame to a RangeIndex.
- set_index(): sets the index of a DataFrame to a specified column.
- rename(): renames columns or index labels of a DataFrame.
- drop(): drops rows or columns from a DataFrame.
- drop_duplicates(): removes duplicate rows from a DataFrame.
- duplicated(): returns a boolean mask indicating duplicate rows.
- merge_ordered(): merges two DataFrames and sorts the result.
- merge_asof(): merges two DataFrames based on nearest match.
- interpolate(): fills missing values in a DataFrame using interpolation.
- diff(): calculates the difference between consecutive values in a DataFrame or Series.
- pct_change(): calculates the percentage change between consecutive values in a DataFrame or Series.
- cumsum(): calculates the cumulative sum of a DataFrame or Series.
- cumprod(): calculates the cumulative product of a DataFrame or Series.
- cummin(): calculates the cumulative minimum of a DataFrame or Series.
- cummax(): calculates the cumulative maximum of a DataFrame or Series.
- shift(): shifts the values of a DataFrame or Series by a specified number of periods.
- fillna(): fills missing values in a DataFrame or Series.
Comments
Post a Comment