In order to comment on multiple lines at once in Jupyter Notebook, you have to select the required lines and then press the Ctrl
+ /
.
For example:
df = pd.DataFrame() for file in os.listdir("SampleData"): if file.endswith(".csv"): tmp = pd.read_csv(os.path.join("SampleData", file)) df = pd.concat([df,tmp], ignore_index = True) df.drop_duplicates(inplace= True)
Then we select all the rows and press the Ctrl
and /
and voilà!
# df = pd.DataFrame() # for file in os.listdir("SampleData"): # if file.endswith(".csv"): # tmp = pd.read_csv(os.path.join("SampleData", file)) # df = pd.concat([df,tmp], ignore_index = True) # df.drop_duplicates(inplace= True)
Similarly, by pressing again the Ctrl
and /
we uncomment the code!