Re: Loading CSV Data in Model

2021-04-30 Thread Philip Mutua
Hi, You check an Implementation I did using Django Rest framework over here hope that it will help you. I was using pandas to read the csv records to the model. https://github.com/pmutua/drf_csv_xlsx_file_upload/blob/master/patients/views.py On Thu, Apr 29, 2021 at 5:23 PM 'Muhammad Asim

Re: Loading CSV Data in Model

2021-04-29 Thread Franck Tchouanga
*import pandas as pd* *data = pd.read_csv('your file', index_col=0)* On Thu, Apr 29, 2021 at 3:51 PM Franck Tchouanga wrote: > To load a csv file in python you use * pd.read_csv('your file', > index_col=0) . * > > *So you need to use the library pandas.* > > *Hope it helps.* > > On Thu, Apr

Re: Loading CSV Data in Model

2021-04-29 Thread Franck Tchouanga
To load a csv file in python you use * pd.read_csv('your file', index_col=0) . * *So you need to use the library pandas.* *Hope it helps.* On Thu, Apr 29, 2021 at 3:23 PM 'Muhammad Asim Khaskheli' via Django developers (Contributions to Django itself) < django-developers@googlegroups.com>

Re: Loading CSV Data in Model

2021-04-29 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Hi! I think you've found the wrong mailing list for this post. This mailing list is for discussing the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely

Loading CSV Data in Model

2021-04-29 Thread 'Muhammad Asim Khaskheli' via Django developers (Contributions to Django itself)
Hi, I wanted to ask how to load csv data into the model. What steps do we have to follow . I have made this function but how exactly to run this code because, python manage.py loaddata wont work. def import_data(): with open('sample-dataset.csv') as f: reader = csv.reader(f) for row in