django-pandas
django-pandas copied to clipboard
Tools for working with pandas in your Django projects
I recently wrote the following for a project, but `django-pandas` actually seems like a better home for it. The idea is basically to implement `to_sql` via the Django ORM to...
ForeignKey lookup works as long as no null values are present. But I also have some models where null values are allowable, for example: ``` class Foo(models.Model): name = models.CharField(max_length=64,...
``` class Testing1(models.Model): symbol = models.CharField('Ticker', max_length=32, primary_key=True) tf = models.CharField('timeframe', max_length=1) class Testing2(models.Model): symbol = models.ForeignKey(Testing1, on_delete=models.CASCADE) price = models.CharField('price', max_length=1) t = Testing1.objects.create(symbol='AAPL', tf='5') t Out[6]: Testing2.objects.create(symbol=t, price='1')...
I have model Status and Station, that have many to many relations. Following command: ```python read_frame(Status.objects.values('id', 'stations__id'), verbose=False) ``` returns: ``` id stations__id 0 1 NaN 1 2 NaN 2...
When I'm instructing queryset to be converted to Pandas dataframe with **to_dataframe(['id', 'employee', 'employee_id'],index='job_date')** In df's column employee_id I have the same value as employee. ``` In [97]: df =...
This means if a custom manager is used, without using the extremely generic "objects" the whole thing does not work. # Suggested Fix The real problem is in `utils.replace_pk`. The...
This PR is an attempt to abate severe memory pressure from `read_frame` when trying to load a very large table. It is a two-pronged approach. - Fix #63 by using...
Hi, I have the following error when using to_timeseries on my django project. What's weird is that it's working when I use my local cache, but when I use a...
This part: ``` To set full_name as the DataFrame index qs.to_dataframe(['age', 'wage'], index='full_name']) You can use filters and excludes qs.filter(age__gt=20, department='IT').to_dataframe(index='full_name') ``` Should be under the DataFrameManager heading, no?
I am enjoying django-pandas. When I define a query set and use qs.to_dataframe(index='custom_int_index_col'), my index column is always converted to a datetime object. I could be missing some greater context,...