Ways to import `PrometheusConnect` without also importing **huge** pandas and matplotlib
See original GitHub issueIs your feature request related to a problem? Please describe.
I found this simple import
from prometheus_api_client import PrometheusConnect
not only import PrometheusConnect
itself, but also pandas and possibly matplotlib, which take about 50MB more unnecessary memory when I donβt want to use DataFrames and plot them.
Is there any way to only import PrometheusConnect
without also importing huge pandas and matplotlib?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Tips & tricks to import data into Pandas from various ... - Medium
Pandas library has cemented its place in the Data Science world. This article shows ways to import data into Pandas from different dataΒ ......
Read more >Importing Data into pandas - DataCamp
Learn how to load and import web data formats such as JSON & HTML into pandas DataFrames. Follow our tutorial and code examples...
Read more >Python Data Analysis with Pandas and Matplotlib - Coding Club
Learn how to filter data in a Pandas DataFrame; Learn how to read and sort data from a file; Understand the basics of...
Read more >How to handle large datasets in Python with Pandas and Dask
Now let's have a look at what kind of data we have here and import it into the dataframe. The very first memory...
Read more >10 minutes to pandas β pandas 1.5.2 documentation
This is a short introduction to pandas, geared mainly for new users. You can see more complex recipes in the Cookbook. Customarily, we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @thetaprimeprime, thatβs an great observation! I did some memory profiling and can confirm that the additional pandas and matplotlib imports do indeed increase the memory usage by about ~45MB.
At the moment, I donβt think so. But I believe this would be a nice and welcome improvement π Is this something youβd like to work on, or would you rather someone from our team do it?
One way to accomplish this could be to refactor this python module into submodules, something like this:
Just a suggestion off the top of my head, we should explore other ideas as well.
/cc @4n4nd
@sesheta: Closing this issue.
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.