DS WITH Python | Shikhar

Discussion in 'Big Data and Analytics' started by Kunal Guwalani, Aug 10, 2019.

  1. Kunal Guwalani

    Kunal Guwalani Well-Known Member
    Simplilearn Support

    Joined:
    Jul 17, 2018
    Messages:
    168
    Likes Received:
    14
    Hi All,

    Use this thread to ask queries related to data science with python.
     
    #1
  2. Amarish Shimpankar

    Amarish Shimpankar New Member

    Joined:
    Jun 29, 2019
    Messages:
    1
    Likes Received:
    0
    how to enable notifications here
     
    #2
  3. GOMATHI SANKAR

    GOMATHI SANKAR New Member

    Joined:
    Jun 25, 2019
    Messages:
    1
    Likes Received:
    0
    Sir,
    when can I get the statistics book that you've told to put upon in the drive
     
    #3
  4. Raja Tyagi

    Raja Tyagi New Member

    Joined:
    Jun 18, 2019
    Messages:
    1
    Likes Received:
    0
    link for python practice




    Regards
    Raja Tyagi
     
    #4
  5. Shikhar Parashar(4707)

    Alumni

    Joined:
    Feb 13, 2014
    Messages:
    5
    Likes Received:
    2
  6. Shikhar Parashar(4707)

    Alumni

    Joined:
    Feb 13, 2014
    Messages:
    5
    Likes Received:
    2
    PLEASE LOOK FOR SENDTEX ON YOUTUBE
     
    #6
  7. Tathagat Kishore Mishra

    Joined:
    Jun 14, 2019
    Messages:
    12
    Likes Received:
    8
    @Amrish you can subscribe the notification by clicking on "Watch thread at Top=Right corner"
     
    #7
    Last edited: Aug 24, 2019
  8. Sujatha Devi KVV

    Joined:
    Jun 30, 2019
    Messages:
    2
    Likes Received:
    0
  9. Pawan Sundaram

    Joined:
    Jul 5, 2019
    Messages:
    3
    Likes Received:
    0
    I'd been having issues with my laptop and switched to different one now.. I'm now having issues uploading a csv on the notes.. The command I'm using after importing the file is

    df = pd.read_csv('train.csv')
    os.getcwd()
     
    #9
  10. amitv08

    amitv08 Member

    Joined:
    Mar 23, 2016
    Messages:
    3
    Likes Received:
    0
    Hello Pawan,

    os.getcwd() gives current working directory. Now if your csv file is present in that directory you can go ahead and
    df = pd.read_csv('train.csv')

    But if thats not the case i.e. if your file is on different directory then you have to use
    os.chdir("#Provide the path for .csv file") and then
    df = pd.read_csv('train.csv')

    e.g.
    os.chdir("C:\\Users\\Admin\\Downloads\\SimpliLearn\\DataScience\\Assignment")
    os.getcwd()
    df = pd.read_csv('train.csv')
    df.describe()

    Hope this helps
     
    #10
  11. Chandraleela

    Chandraleela Member

    Joined:
    Aug 25, 2019
    Messages:
    4
    Likes Received:
    0
    Can anyone tell me how can I know how to write mathematical model. Mathematical and scientific models are used in Data Science to find patterns and solutions but I dont know how to learn this. Please advice someone.
     
    #11
  12. GP DAS

    GP DAS Member
    Alumni

    Joined:
    Jan 3, 2016
    Messages:
    8
    Likes Received:
    2
    Hi everyone. I think the PPT is not uploaded. Anyone having any idea?
     
    #12
  13. Jyoti Saxena

    Jyoti Saxena Member

    Joined:
    May 20, 2019
    Messages:
    2
    Likes Received:
    0
    Hi All,

    Can anyone please help me out with Cookbook link, from where I can get the book in pdf format.
     
    #13
  14. RAVI RANJAN CHAUBEY

    Joined:
    Mar 29, 2019
    Messages:
    3
    Likes Received:
    0
    #14
  15. RAVI RANJAN CHAUBEY

    Joined:
    Mar 29, 2019
    Messages:
    3
    Likes Received:
    0
    #15
  16. Syed Ammar Ahmed

    Syed Ammar Ahmed New Member

    Joined:
    Jun 25, 2019
    Messages:
    1
    Likes Received:
    0
    Questions for Discussion:

    1) Numpy supports the following representations
    a) Function Representation: np.min(trip_mph)
    b) Method Representation: trip_mph.min()

    Which of these representations are commonly used and why?

    2) Is it correct to say, that a list of lists as shown below is a 2-Dimensional array?

    list_ex = [
    [0,1],
    [1,3]
    ]​

    3) If vectorization is a concept of replacing 'for' loops with operations applied to multiple data points at once. How does this concept make the processing of data faster?
     
    #16
  17. GP DAS

    GP DAS Member
    Alumni

    Joined:
    Jan 3, 2016
    Messages:
    8
    Likes Received:
    2
    @syed, Q.No.2 . Yes it is a two dimensional array. Q.1 & Q3. I don't know.
     
    #17
    Syed Ammar Ahmed likes this.
  18. GP DAS

    GP DAS Member
    Alumni

    Joined:
    Jan 3, 2016
    Messages:
    8
    Likes Received:
    2
    I tried to find Quartiles (Q1, Q2, & Q3) of array s1=[18,45,66,70,76,83,88,90,90,95,95,98]
    np.percentile(s1,[25,50,75])
    np.quantile(s1,[.25, .5, .75])
    or
    df=pd.DataFrame({'A':[18,45,66,70,76,83,88,90,90,95,95,98]})
    df.quantile([.25,.5,.75], axis=0)
    df.quantile([.25,.5,.75])
    All gives same result
    array([69. , 85.5 , 91.25])
    But what I feel and as per a video in Youtube Q1 in this case = (66+70)/2= 68 but our result is 69
    Similarly Q3 = (90+95)/2 = 92.5 but our result is 91.25
    Can anyone explain?
     
    #18
  19. Shikhar Parashar(4707)

    Alumni

    Joined:
    Feb 13, 2014
    Messages:
    5
    Likes Received:
    2
    Please read the functions you are using in detail on docs.scipy.org and python.org.
    The answer to your question lies in the interpolation parameter of the quantile and percentile function. By default, the interpolation is 'linear' because of which you are getting these results. To get your desired results, please use the interpolation argument as 'midpoint'.

    Very good question. Commendable efforts. Keep this going. Long way to go.
     
    #19
  20. Chandraleela

    Chandraleela Member

    Joined:
    Aug 25, 2019
    Messages:
    4
    Likes Received:
    0
    Thanks sir. I went through python.org and it is really helpful.
     
    #20
  21. Chandraleela

    Chandraleela Member

    Joined:
    Aug 25, 2019
    Messages:
    4
    Likes Received:
    0
    Hello Shikhar sir,

    Could you please let me know how the vartuple takes argument. It is printing 70,60 when given printinfo(70,60,50). I didnt understand this function?

    # Function definition is here

    def printinfo( arg1,*vartuple ):
    "This prints a variable passed arguments"print("Output is: ")
    print(arg1)

    for var in vartuple:
    print(var)
    return

    # Now you can call printinfo function
    printinfo(10)
    printinfo(70,60,50)
     
    #21
  22. Pawan Sundaram

    Joined:
    Jul 5, 2019
    Messages:
    3
    Likes Received:
    0
    Hey all, I'm trying to do the project on stocks. I was trying to import yahoo data reader using the pandas_datareader.data and pandas_datareader.. I'm not able to import this, it says no module as such name. Has anyone tried to do this project, if yes, how are we getting the data from yahoo data reader.
     
    #22
  23. Kirthi Iyengar

    Kirthi Iyengar New Member

    Joined:
    Jun 28, 2019
    Messages:
    1
    Likes Received:
    0
    Yes Pavan..
    qundl is not working for me.
    Hence, used another way but that gives error:
    ImmediateDeprecationError:
    Google finance has been immediately deprecated due to large breaks in the API without the
    introduction of a stable replacement. Pull Requests to re-enable these data
    connectors are welcome.

    See https://github.com/pydata/pandas-datareader/issues
     
    #23
  24. Chandraleela

    Chandraleela Member

    Joined:
    Aug 25, 2019
    Messages:
    4
    Likes Received:
    0


    Can anyone help me with the above code.
     
    #24
  25. GP DAS

    GP DAS Member
    Alumni

    Joined:
    Jan 3, 2016
    Messages:
    8
    Likes Received:
    2
    Hi Chandraleela
    just referring your problem
    Could you please let me know how the vartuple takes argument. It is printing 70,60 when given printinfo(70,60,50).

    def printinfo( arg1,*vartuple ):
    As this function says, you must supply one extra argument. Otherwise the tuple will be empty,
    If you supply printinfo(70,60,50). inside tuple values are 60 & 50.
    arg1=70 in this case.
    But what you have written "It is printing 70,60 ", I think it is 60 & 50,
    If you give print(arg1) - it will print 70 and in the loop
    for var in vartuple:
    print(var)
    return

    the values inside tuple i.e 60 & 50 should be printed.
    Please check right indentation and revert back if it works
    Thanks.
     
    #25
  26. RAVI RANJAN CHAUBEY

    Joined:
    Mar 29, 2019
    Messages:
    3
    Likes Received:
    0
    def printinfo(arg1,*vartuple):
    for var in vartuple:
    print(var)
    printinfo(70,60,50)

    Hello Ma'am Actually * or star arguments takes multiple input in a function. In simple language you can say that it take tuple as input. Now in this case first argument that is arg1 is a normal argument which will store 70 and next two element that is 60 and 50 will go to vartuple. So output will be 60 and 50 as we are iterating only in vartuple inside function.

    Hope this will help :)
     
    #26
  27. Pawan Sundaram

    Joined:
    Jul 5, 2019
    Messages:
    3
    Likes Received:
    0
    Were you able to get it? I tried other options too, but it looks like Yahoo and Google reader have blocked all the fixes :D
     
    #27
  28. Bhavya V Nair

    Bhavya V Nair New Member

    Joined:
    Mar 28, 2019
    Messages:
    1
    Likes Received:
    0
    Hi Team,
    I tried the following code:
    import numpy as np
    dftable["CATEGORY"] = np.where((dftable["Status"] == "Open")or(dftable["Status"] == "Pending"),"OPEN","CLOSED" )
    I am getting following error
    ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
    Please help.
     
    #28

Share This Page