- See if you have Visual Studio Code installed by looking in your apps. If you don't, have it installed, install it from here
- Configure Visual Studio Code to be your editor for git. From the command line run:
git config --global core.editor "code -w" - Mac users: Set Visual Studio Code to open with
codefrom the command line outside VS Code. Instructions here, presscommand+shift+p - Select
Shell Command: Install 'code' command in PATH. Windows users should have the functionality automatically. - Install the
Pythonextension for Visual Studio Code. Click on the Extensions icon in the left side bar and search forPython. Select and install it. - Make
blackyour autoformatter. In the top menu bar goCode->Preferences->Settingsand typeblack. Select UnderPython > Formating: Providerselectblack. You may need topip install blackon the comma
- DoWhy - making causal inference easy (Microsoft) - 2,258
- CausalML - suite of uplift modeling and causal inference methods using machine learning algorithms based on recent research (Uber) - 1,322
- causal impact - implementation of Google's model with all functionalities fully ported and tested - 312
- cfrnet - counterfactual regression (doesn't appear to be actively developed) - 135
- Causality - tools for causal analysis using observational (rather than experimental) datasets (doesn't appear to be actively developed) - 804
- Causal Discovery Toolbox - causal inference in graphs and pairwise settings - 333
See the Source file here: https://github.com/discdiver/pandas_errors
Each error is explained, an example is shown, and then the correct code is shown, if applicable.
If you have other common errors you think would be helpful for others, please leave them in the comments and ping me on Twitter @discdiver.
There are many potential Git workflows. The following is a basic workflow for someone working alone, using different local branches, pushing directly the master remote branch.
To make a new branch locally:
git checkout -b my_branch_name- create and move to a new branch- Do work.
git status- check on things.git add .- stage changes to be committed.git commit -m "my_commit-message"- commit changes.
- From the GitHub GUI: Fork the repository (click
fork). - From your forked repository in the GitHub GUI: Click
cloneand copy the URL. - From the command line: in the directory you want to put your local copy of the repository, type
git statusto make sure you are not already in a local git repository folder. - Then type
git clone insert_the_url_from_above cdinto the cloned repository.git remote -vto see the tracking versions. You should see origin, but no upstream.- From the original repository in the GitHub GUI (not yours): Click
cloneand copy the URL. git remote add upstream insert_url_of_original_repository_from_the_step_above- the URL to insert will NOT have your username in it.
If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).
-
Shift+Enterrun selected cell or cells - if no cells below, insert a code cell below -
Ctrl+Btoggle hide/show left sidebar -
Ctrl+Ssave and checkpoint -
Ctrl+Shift+Ssave as
Python virtual environment management can be tricky, but it's essential for isolating dependencies.
You have several options for virtual environment managers. We provide instructions for uv, venv, and conda below.
uv is relatively new, but it's the fastest and becoming very popular. If you don't already have a Python virtual environment manager, we suggest using it.
| import pandas as pd | |
| import numpy as np | |
| import plotly.offline as py | |
| import plotly.graph_objs as go | |
| import json | |
| py.init_notebook_mode(connected=False) | |
| izip = zip |
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: my-deployment | |
| spec: | |
| replicas: 3 | |
| selector: | |
| matchLabels: | |
| app: my-app | |
| template: |
| apiVersion: apps/v1 # Deployments get an "apps/v1" - no longer in beta. | |
| kind: Deployment # kind is for the type of resource. | |
| metadata: # metadata provides information about the resource. | |
| name: my-deployment # We name our Deployment my-deployment. | |
| #This is the value at metadata.name. | |
| spec: | |
| replicas: 3 # Specify we want 3 Pods in our ReplicaSet. | |
| selector: | |
| matchLabels: # spec.selector.matchLabels tells the Deployment | |
| app: my-app # to match Pods with a key - value label pair |