Monday, July 20, 2026
Social icon element need JNews Essential plugin to be activated.
No Result
View All Result
Digital Currency Pulse
  • Home
  • Crypto/Coins
  • NFT
  • AI
  • Blockchain
  • Metaverse
  • Web3
  • Exchanges
  • DeFi
  • Scam Alert
  • Analysis
Crypto Marketcap
Digital Currency Pulse
  • Home
  • Crypto/Coins
  • NFT
  • AI
  • Blockchain
  • Metaverse
  • Web3
  • Exchanges
  • DeFi
  • Scam Alert
  • Analysis
No Result
View All Result
Digital Currency Pulse
No Result
View All Result

Tips and Tricks to Organize Jupyter Notebook Visualizations | by Matthew Andres Moreno | Jan, 2024

January 23, 2024
in Artificial Intelligence
Reading Time: 6 mins read
A A
0

[ad_1]

Optimize your knowledge science workflow by automating matplotlib output — with 1 line of code. Right here’s how.

Matthew Andres Moreno
Towards Data Science

Naming issues is tough. After an extended sufficient day, we’ve all ended up with the highly-descriptive likes of “graph7(1)_FINAL(2).png” and “output.pdf” Look acquainted?

We will do higher — and fairly simply, really.

After we use data-oriented “seaborn-esque” plotting mechanisms, the elements for a descriptive filename are all there. A typical name appears to be like like this,

sns.scatterplot(knowledge=suggestions, x=”total_bill”, y=”tip”, hue=”time”)

Proper there we all know we’ve acquired “total_bill” on the x axis, “time” shade coded, and so on. So what if we used the plotting perform identify and people semantic column keys to arrange the output for us?

Right here’s what that workflow appears to be like like, utilizing the teeplot software.

import seaborn as sns; import teeplot as tptp.save = {“.eps”: True, “.pdf”: True} # set customized output conducttp.tee(sns.scatterplot,knowledge=sns.load_data(“suggestions”), x=”total_bill”, y=”tip”, hue=”time”)

teeplots/hue=time+viz=scatterplot+x=total-bill+y=tip+ext=.epsteeplots/hue=time+viz=scatterplot+x=total-bill+y=tip+ext=.pdf

We’ve really finished three issues on this instance — 1) we rendered the plot within the pocket book and a pair of) we’ve saved our visualization to file with a significant filename and three) we’ve hooked our visualization right into a framework the place pocket book outputs may be managed at a worldwide stage (on this case, enabling eps/pdf output).

This text will clarify learn how to harness the teeplot Python package deal to get higher organized and unlock your psychological workload to concentrate on extra fascinating issues.

I’m the first creator and maintainer of the challenge, which I’ve utilized in my very own workflow for a number of years and located helpful sufficient to package deal and share extra extensively with the group. teeplot is open supply beneath the MIT license.

teeplot is designed to simplify work with knowledge visualizations created with libraries like matplotlib, seaborn, and pandas. It acts as a wrapper round your plotting calls to deal with output administration for you.

teeplot workflow in motion

Right here’s learn how to use teeplot in 3 steps,

Select Your Plotting Perform: Begin by deciding on your most popular plotting perform, whether or not it’s from matplotlib, seaborn, pandas, and so on. or one you wrote your self.Add Your Plotting Arguments: Go your plotting perform as the primary argument to tee, adopted by the arguments you wish to use in your visualization.Automated Plotting and Saving: teeplot captures your plotting perform and its arguments, executes the plot, after which takes care of wrangling the plot outputs for you.

That’s it!

Subsequent, let’s have a look at 3 transient examples that reveal: a) primary use, b) customized post-processing, and c) customized plotting features.

On this instance, we go a DataFrame df’s member perform df.plot.field as our plotter and two semantic keys: “age” and “gender.” teeplot takes care of the remainder.

# tailored pandas.pydata.org/docs/reference/api/pandas.DataFrame.plot.field.htmlimport pandas as pd; from teeplot import teeplot as tp

age_list = [8, 10, 12, 14, 72, 74, 76, 78, 20, 25, 30, 35, 60, 85]df = pd.DataFrame({“gender”: record(“MMMMMMMMFFFFFF”), “age”: age_list})

tp.tee(df.plot.field, # plotter…column=”age”, by=”gender”, figsize=(4, 3)) # …forwa

teeplots/by=gender+column=age+viz=field+ext=.pdfteeplots/by=gender+column=age+viz=field+ext=.png

[ad_2]

Source link

Tags: AndresJanJupyterMatthewMorenoNotebookOrganizeTipsTricksVisualizations
Previous Post

Bitcoin Price (BTC) Falls Despite Bitcoin ETF Launch

Next Post

How to handle a ransomware attack 

Next Post
How to handle a ransomware attack 

How to handle a ransomware attack 

Bite-Sized Budgeting: Can it Help a New Generation of Savers?

Bite-Sized Budgeting: Can it Help a New Generation of Savers?

Benefits, Best Practices, Hosting & More

Benefits, Best Practices, Hosting & More

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Social icon element need JNews Essential plugin to be activated.

CATEGORIES

  • Analysis
  • Artificial Intelligence
  • Blockchain
  • Crypto/Coins
  • DeFi
  • Exchanges
  • Metaverse
  • NFT
  • Scam Alert
  • Web3
No Result
View All Result

SITEMAP

  • About us
  • Disclaimer
  • DMCA
  • Privacy Policy
  • Terms and Conditions
  • Cookie Privacy Policy
  • Contact us

Copyright © 2024 Digital Currency Pulse.
Digital Currency Pulse is not responsible for the content of external sites.

No Result
View All Result
  • Home
  • Crypto/Coins
  • NFT
  • AI
  • Blockchain
  • Metaverse
  • Web3
  • Exchanges
  • DeFi
  • Scam Alert
  • Analysis
Crypto Marketcap

Copyright © 2024 Digital Currency Pulse.
Digital Currency Pulse is not responsible for the content of external sites.