Programming Basics and Data Analytics with Python | Anand

Discussion in 'Big Data and Analytics' started by Nishant_Singh, Apr 25, 2020.

  1. Mahadev Damodhar Kale

    Joined:
    Nov 18, 2019
    Messages:
    3
    Likes Received:
    0
    Hi Anand,
    I am able to found the way to update the Size column. Values are updated as expected in the column but the note book size is getting increased. I might be be doing something wrong in the looping. Please help me to solve this problem. Below is my code.

    def size_clearner(size):
    for x in ar['Size']:
    print ("Orignal x :", x)
    if 'M' in x:
    x = x.replace('M','')
    c = float (x) *1000
    print ("converted x is :", c)

    elif 'k' in x:
    c = x.replace('k','')
    print("converted x is :", c)
    c = float (c)


    elif 'Varies with device' in x:
    c = x.replace('Varies with device','NA' )
    print ("Varies with device :",c )

    Thanks in advance !!
     
    #151
  2. Hardik Patil

    Hardik Patil New Member

    Joined:
    Feb 21, 2020
    Messages:
    1
    Likes Received:
    0
    Hi Anand,

    Facing issue in LinearRegression

    lm=LinearRegression()
    lm.fit(x_train,y_train) # All columns are Float

    Model is not fitting it is giving below error kindly help to short out

    ValueError Traceback (most recent call last)
    <ipython-input-173-a999012afb20> in <module>
    1 lm=LinearRegression()
    ----> 2lm.fit(x_train,y_train)

    ~\anaconda3\lib\site-packages\sklearn\linear_model\_base.py in fit(self, X, y, sample_weight)
    490 n_jobs_ = self.n_jobs
    491 X, y = check_X_y(X, y, accept_sparse=['csr', 'csc', 'coo'],
    --> 492 y_numeric=True, multi_output=True)
    493
    494 if sample_weight is not None:

    ~\anaconda3\lib\site-packages\sklearn\utils\validation.py in check_X_y(X, y, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, multi_output, ensure_min_samples, ensure_min_features, y_numeric, warn_on_dtype, estimator)
    753 ensure_min_features=ensure_min_features,
    754 warn_on_dtype=warn_on_dtype,
    --> 755 estimator=estimator)
    756 if multi_output:
    757 y = check_array(y, 'csr', force_all_finite=True, ensure_2d=False,

    ~\anaconda3\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, warn_on_dtype, estimator)
    576 if force_all_finite:
    577 _assert_all_finite(array,
    --> 578 allow_nan=force_all_finite == 'allow-nan')
    579
    580 if ensure_min_samples > 0:

    ~\anaconda3\lib\site-packages\sklearn\utils\validation.py in _assert_all_finite(X, allow_nan, msg_dtype)
    58 msg_err.format
    59 (type_err,
    ---> 60 msg_dtype if msg_dtype is not None else X.dtype)
    61 )
    62 # for object dtype data, we only check for NaNs (GH-13254)

    ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
     
    #152
  3. Sahithi Katreddi

    Joined:
    Jun 11, 2020
    Messages:
    10
    Likes Received:
    7
    Hi Sir,

    I have joined one of your class in Python and couldn't continue after that due to personal issues. Could you please let me know when is your next batch starting. I am taking the data science masters program and I have also registered for a batch starting from August 8th,2020. I am looking forward to join your class and continue my good learning.

    Thank you!
     
    #153
  4. anand.s.subramaniam

    anand.s.subramaniam Well-Known Member
    Alumni

    Joined:
    Mar 28, 2018
    Messages:
    201
    Likes Received:
    25
     
    #154
  5. anand.s.subramaniam

    anand.s.subramaniam Well-Known Member
    Alumni

    Joined:
    Mar 28, 2018
    Messages:
    201
    Likes Received:
    25

    Hi,
    I have not yet been given a batch.
     
    #155
  6. anand.s.subramaniam

    anand.s.subramaniam Well-Known Member
    Alumni

    Joined:
    Mar 28, 2018
    Messages:
    201
    Likes Received:
    25


    Hi ,
    Your logic has nothing to do with the size of the notebook. Reasons for increase in notebook size might be due to the fact that you are displaying large datasets in the notebook itself, of you are displaying some images.
     
    #156

Share This Page