Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Pandas Basic SnippetsNew to Visual Studio Code? Get it now.

Pandas Basic Snippets

Snippington

|
9,614 installs
| (0) | Free
Basic snippets for development with Pandas package.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Snippington Python Pandas Basic

Visual Studio Code extension for Pandas code snippets.

This works with ipynb (Jupyter Notebook) files in Visual Studio Code too.

Data Exploratory Shortcuts

Prefix Description
pd: imp Import Pandas
pd: read-csv Read CSV File
pd: read-csv-chunked Read CSV File in Chunks
pd: read-csv-skiprows Read CSV with skipping rows
pd: stats Show aggregate stats.
pd: stats-custom Get Custom Aggregate Stats
pd: shape Get the shape of dataframe
pd: row-count Get the row count of dataframe
pd: column-count Get the column count of dataframe
pd: first-x-rows Get the first x rows of dataframe
pd: last-x-rows Get the last x rows of dataframe
pd: set-categories Define categories
pd: frequency-distribution Get frequency distribution of values for a column
pd: data-sample Get sample of data from dataframe
pd: column-select Select single column from dataframe
pd: column-select-multiple Select multiple columns from dataframe
pd: rows-specific-columns Select rows by indices for specific column names in dataframe
pd: rows-by-index Select rows from dataframe by indices
pd: columns-by-index Select columns from dataframe by indices
pd: group-by-count Group By with Count Aggregate
pd: group-by-mean Group By with Mean
pd: window-expanding-mean Expanding Window Mean
pd: window-rolling-mean Expanding Window Mean

Data Manipulation Shortcuts

Prefix Description
pd: dataframe-create Create custom dataframe
pd: columns-rename Assign new column names to dataframe
pd: columns-rename-specific Assign new column names to specific columns in dataframe
pd: columns-drop Drop columns by name
pd: sort-by-column Sort values in dataframe by column
pd: filter Filter dataframe based on condition/match
pd: filter-by-query Filter dataframe by query based on conditions
pd: apply-all Apply function to all of dataframe
pd: apply-single-column Apply function to a specific column
pd: apply-multiple-columns Apply function to multiple columns
pd: apply-column-lambda Apply lambda function to column
pd: convert-numeric Convert all columns to numeric type
pd: convert-column-numeric Convert a single column to numeric type
pd: convert-columns-numeric Convert multiple columns to numeric type
pd: set-data-types Assign data types to columns
pd: dataframes-concatenate Concatenate dataframes
pd: pivot-table Create Pivot table

Missing Data Fix Shortcuts

Prefix Description
pd: fill-mean Fill missing values with mean values
pd: fill-median Fill missing values with median values
pd: fill-mode Fill missing values with modal values

Output Shortcuts

Prefix Description
pd: write-to-excel Write dataframe to Excel file
pd: write-to-csv Write dataframe to CSV file

Plotting Shortcuts

Prefix Description
pd: scatter-plot Create a scatter Plot
pd: bar-plot Create a bar plot
pd: line-plot-multiple Create a multiple line plot
pd: plot-save Save plot to output file
pd: bar-plot-horizontal Horizontal bar plot
pd: histogram Make a histogram
pd: histogram-columns Make a histogram for each column

Pre-reqs

Make sure you have Python, Pandas and Matplotlib installed (optional: for plots only).

pip3 install pandas
pip3 install matplotlib
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft