I can see the matching parenthesis hightlights green when I hover around them, but is it possible to add additional color syntax to them so that the matching parenthesis have different colors.
Example code:
# create new features
df = (df
.withColumn(("rooms_per_hh", F.round(col('total_rooms') / col('households'), 2)))
.withColumn(("pop_per_hh", F.round(col('pop') / col('households'), 2)))
.withColumn(("bedrooms_per_rooms", F.round(col('total_bedrooms') / col('total_rooms'), 2)))
)
I like to see different colors for different parentheses here.
Related links:
- Changing jupyter's matching parenthesis color
- Replace / remove highlighting in Jupyter Notebook with custom theme
Required output:
Green = a string Grey = a comment Orange = a number or a parameter (or a predefined property name(for instance .length )) Purple = special keyword (like var , if , else , etc) Light-blue = operator ( + , - , * , / , = , < , == , && , etc) Dark-blue = a predefined function name or the function name in a function ...
Jupyter notebook displays do not use the syntax highlighting theme in Preferences to display code blocks.
We can change the colour of the text using the html <font> tag. We can use colour names or hexadecimal colour code: Example: <font color=green>green text</font>, <font color=blue>*blue italised text*</font> and <font color=#FF0000>**red bold text**</font>.
This is because the indentation is screwed up. For consistency the codemirror parser will make a red line if it's not indented 4 spaces (or if it's indented with tabs, depending on codemirror version).
I think you can use jupyter-notebook-themes Google Chrome and add .cm-s-ipython .CodeMirror-matchingbracket { color: black !important;}
or some thing else to change coloring of inner parenthesis.
Then you can add it to your Chrome as a custom extension.
You can run the jupyter in VSCode, using the Bracket Pair Colorizer ( or Rainbow Brackets ) And will give you something like this :
You import the .ipynb file, have the "Run Cell" command + can import the Color extensions.... It's not perfect ( not really using "Jupyter" ) but it works...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With