Re: Data Science and sql problem

2020-07-27 Thread Integr@te System
Hi Friend,

If you want more option, new t-sql with predict statement directly on db.



On Mon, Jul 27, 2020, 4:25 PM AJ Wattoo  wrote:

> as far i understand you want to connect with postgreSQL database on
> jupyter notebook :
> you can do like this
> 1. install -c anaconda psycopg2 and install -c anaconda sqlalchemy
>
> *2. *from sqlalchemy import create_engine and import pandas as pd
>
> 3. engine=create_engine(‘postgres+psycopg2://postgres:@localhost
> :5432/anyname’)
>
> In thes case *postgres *= name of my databse , ** is my password ,
> *localhost*=host, *port *= 5432, *anyname* = database name
>
> 4. con = engine.connect()
>
> 5. df=*pd.read_sql_query(*SQL queries #whatever you want to get from
> database*)*
>
> and then saving that data in csv
> 6. df.to_csv('file_name.csv')
> On Monday, July 27, 2020 at 6:37:44 AM UTC+2 yame...@gmail.com wrote:
>
>> Try sql alchemy, if you need a full access with many functionality. Other
>> than that, u can connect directly to the database through python. The exact
>> implementation will depend on the database type
>>
>> Le dim. 26 juil. 2020 à 18:15, Gurmeet Kaur  a
>> écrit :
>>
>>> you could try using connection and cursor to connect nd then pandas to
>>> read csv using readcsv function
>>>
>>> On Sun, Jul 26, 2020, 11:59 AM Prashant Singh 
>>> wrote:
>>>
 How can i connect database with help of function in jupyter notebook
 and then conver data into csv to build model ?

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/dd90d45a-dfbf-47a6-86b2-a4e600d4a9c9n%40googlegroups.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAEbKJVi%3DPfRdjN7AxWiEb-BuUZ_cjwinBpwrbQ9-iTi7e_hyrQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/97217142-867e-4f5a-9c52-17fa3a6f7ce6n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAP5HUWr19SEW4L8Or4UswhtXgNQtcTwbdRYkrgYHdELh-JL%2BOQ%40mail.gmail.com.


Re: Data Science and sql problem

2020-07-27 Thread AJ Wattoo
as far i understand you want to connect with postgreSQL database on jupyter 
notebook :
you can do like this
1. install -c anaconda psycopg2 and install -c anaconda sqlalchemy

*2. *from sqlalchemy import create_engine and import pandas as pd

3. 
engine=create_engine(‘postgres+psycopg2://postgres:@localhost:5432/anyname’)

In thes case *postgres *= name of my databse , ** is my password , 
*localhost*=host, *port *= 5432, *anyname* = database name

4. con = engine.connect()

5. df=*pd.read_sql_query(*SQL queries #whatever you want to get from 
database*)*

and then saving that data in csv 
6. df.to_csv('file_name.csv')
On Monday, July 27, 2020 at 6:37:44 AM UTC+2 yame...@gmail.com wrote:

> Try sql alchemy, if you need a full access with many functionality. Other 
> than that, u can connect directly to the database through python. The exact 
> implementation will depend on the database type
>
> Le dim. 26 juil. 2020 à 18:15, Gurmeet Kaur  a 
> écrit :
>
>> you could try using connection and cursor to connect nd then pandas to 
>> read csv using readcsv function
>>
>> On Sun, Jul 26, 2020, 11:59 AM Prashant Singh  
>> wrote:
>>
>>> How can i connect database with help of function in jupyter notebook and 
>>> then conver data into csv to build model ?
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/dd90d45a-dfbf-47a6-86b2-a4e600d4a9c9n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAEbKJVi%3DPfRdjN7AxWiEb-BuUZ_cjwinBpwrbQ9-iTi7e_hyrQ%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/97217142-867e-4f5a-9c52-17fa3a6f7ce6n%40googlegroups.com.


Re: Data Science and sql problem

2020-07-26 Thread Yamen Gamal Eldin
Try sql alchemy, if you need a full access with many functionality. Other
than that, u can connect directly to the database through python. The exact
implementation will depend on the database type

Le dim. 26 juil. 2020 à 18:15, Gurmeet Kaur 
a écrit :

> you could try using connection and cursor to connect nd then pandas to
> read csv using readcsv function
>
> On Sun, Jul 26, 2020, 11:59 AM Prashant Singh 
> wrote:
>
>> How can i connect database with help of function in jupyter notebook and
>> then conver data into csv to build model ?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/dd90d45a-dfbf-47a6-86b2-a4e600d4a9c9n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEbKJVi%3DPfRdjN7AxWiEb-BuUZ_cjwinBpwrbQ9-iTi7e_hyrQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOwHV68PecSp_MB-%2B23-tEVzPUjdij69qKR5omgAOuLgnMYSJg%40mail.gmail.com.


Re: Data Science and sql problem

2020-07-26 Thread Gurmeet Kaur
you could try using connection and cursor to connect nd then pandas to read
csv using readcsv function

On Sun, Jul 26, 2020, 11:59 AM Prashant Singh 
wrote:

> How can i connect database with help of function in jupyter notebook and
> then conver data into csv to build model ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/dd90d45a-dfbf-47a6-86b2-a4e600d4a9c9n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEbKJVi%3DPfRdjN7AxWiEb-BuUZ_cjwinBpwrbQ9-iTi7e_hyrQ%40mail.gmail.com.


Data Science and sql problem

2020-07-26 Thread Prashant Singh
How can i connect database with help of function in jupyter notebook and 
then conver data into csv to build model ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dd90d45a-dfbf-47a6-86b2-a4e600d4a9c9n%40googlegroups.com.