'DataFrame' object has no attribute 'to_dataframe'How duplicated items can be deleted from dataframe in...

Does red noise even at low values mean a hardware problem with my camera's sensor?

How do I narratively explain how in-game circumstances do not mechanically allow a PC to instantly kill an NPC?

Including proofs of known theorems in master's thesis

Identical projects by students at two different colleges: still plagiarism?

Taking an academic pseudonym?

Minimum Viable Product for RTS game?

What would be some possible ways of escaping higher gravity planets?

Why don't you get burned by the wood benches in a sauna?

Does copper wire need to say it's copper?

Is layered encryption more secure than long passwords?

Even as admin, I cannot edit DefaultFonts.plist for Notes.app. What am I doing wrong?

Buying a "Used" Router

If I tried and failed to start my own business, how do I apply for a job without job experience?

Solving the linear first order differential equaition?

Can you say "leftside right"?

How can guns be countered by melee combat without raw-ability or exceptional explanations?

How do I fight with Heavy Armor as a Wizard with Tenser's Transformation?

How bad is a Computer Science course that doesn't teach Design Patterns?

Players preemptively rolling, even though their rolls are useless or are checking the wrong skills

Modern Algebraic Geometry and Analytic Number Theory

How to know if I am a 'Real Developer'

I have trouble understanding this fallacy: "If A, then B. Therefore if not-B, then not-A."

Why "rm -r" is unable to delete this folder?

How can I give a Ranger advantage on a check due to Favored Enemy without spoiling the story for the player?



'DataFrame' object has no attribute 'to_dataframe'


How duplicated items can be deleted from dataframe in pandasConvert List to DataFrameComparing dataframe object with string value in djangoSegmenting pandas dataframe with lists as elementsLook for previous date in dataframe that has certain column category in RRemove Local Outliers from Dataframe using pandasAdding multiple columns to spark dataframeMapping column values of one DataFrame to another DataFrame using a key with different header namesEliminating rows in a dataframe based on specific conditionsLabelEncoding a Dataframe













0












$begingroup$


I'm sure I have a small error here that I'm overlooking, but am having a tough time figuring out what I need to change.



Here is my code up until the error I'm getting.



# Load libraries
import pandas as pd
import numpy as np
from pandas.tools.plotting import scatter_matrix
import matplotlib.pyplot as plt
from sklearn import model_selection
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
from sklearn.linear_model import LogisticRegression
from sklearn.tree import DecisionTreeClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.discriminant_analyisis import LinearDiscriminantAnalysis
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC

# Load dataset
names = ['action','reject','approve','occ','loanamt', 'suffolk', 'appinc','typur','unit','married','dep','emp',yjob','self','atotinc','cototinc','hexp']

# from azureml import Workspace
# ws = Workspace(
# workspace_id='',
# authorization_token='==',
# endpoint='https://studioapi.azureml.net'
# )
# ds = ws.datasets['loanapp_c.csv']

ds = pd.read_csv('desktop/python ML/loanapp_c.csv')
dataset = ds.to_dataframe()


I was running this on Azure and am now trying to do it locally. Here is the error I'm getting:



AttributeError                Traceback (most recent call last)
<ipython-input-3-b49a23658806> in <module>()
32
33 ds = pd.read_csv('desktop/python ML/loanapp_c.csv')
---> 34 dataset = ds.to_dataframe()
35
36 # shape

~/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py in_getattr_(self, name)
4374 if self._info_axis.can_hold_identifiers_and_holds_name(name):
return self[name]
-> 4376 return object._getattribute_(self,name)
4377
4378 def _setattr_(self, name, value):

AttributeError: 'DataFrame' object has no attribute 'to_dataframe'


Not sure what I have wrong.










share|improve this question







New contributor




user68346 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$

















    0












    $begingroup$


    I'm sure I have a small error here that I'm overlooking, but am having a tough time figuring out what I need to change.



    Here is my code up until the error I'm getting.



    # Load libraries
    import pandas as pd
    import numpy as np
    from pandas.tools.plotting import scatter_matrix
    import matplotlib.pyplot as plt
    from sklearn import model_selection
    from sklearn.metrics import classification_report
    from sklearn.metrics import confusion_matrix
    from sklearn.metrics import accuracy_score
    from sklearn.linear_model import LogisticRegression
    from sklearn.tree import DecisionTreeClassifier
    from sklearn.neighbors import KNeighborsClassifier
    from sklearn.discriminant_analyisis import LinearDiscriminantAnalysis
    from sklearn.naive_bayes import GaussianNB
    from sklearn.svm import SVC

    # Load dataset
    names = ['action','reject','approve','occ','loanamt', 'suffolk', 'appinc','typur','unit','married','dep','emp',yjob','self','atotinc','cototinc','hexp']

    # from azureml import Workspace
    # ws = Workspace(
    # workspace_id='',
    # authorization_token='==',
    # endpoint='https://studioapi.azureml.net'
    # )
    # ds = ws.datasets['loanapp_c.csv']

    ds = pd.read_csv('desktop/python ML/loanapp_c.csv')
    dataset = ds.to_dataframe()


    I was running this on Azure and am now trying to do it locally. Here is the error I'm getting:



    AttributeError                Traceback (most recent call last)
    <ipython-input-3-b49a23658806> in <module>()
    32
    33 ds = pd.read_csv('desktop/python ML/loanapp_c.csv')
    ---> 34 dataset = ds.to_dataframe()
    35
    36 # shape

    ~/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py in_getattr_(self, name)
    4374 if self._info_axis.can_hold_identifiers_and_holds_name(name):
    return self[name]
    -> 4376 return object._getattribute_(self,name)
    4377
    4378 def _setattr_(self, name, value):

    AttributeError: 'DataFrame' object has no attribute 'to_dataframe'


    Not sure what I have wrong.










    share|improve this question







    New contributor




    user68346 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.







    $endgroup$















      0












      0








      0





      $begingroup$


      I'm sure I have a small error here that I'm overlooking, but am having a tough time figuring out what I need to change.



      Here is my code up until the error I'm getting.



      # Load libraries
      import pandas as pd
      import numpy as np
      from pandas.tools.plotting import scatter_matrix
      import matplotlib.pyplot as plt
      from sklearn import model_selection
      from sklearn.metrics import classification_report
      from sklearn.metrics import confusion_matrix
      from sklearn.metrics import accuracy_score
      from sklearn.linear_model import LogisticRegression
      from sklearn.tree import DecisionTreeClassifier
      from sklearn.neighbors import KNeighborsClassifier
      from sklearn.discriminant_analyisis import LinearDiscriminantAnalysis
      from sklearn.naive_bayes import GaussianNB
      from sklearn.svm import SVC

      # Load dataset
      names = ['action','reject','approve','occ','loanamt', 'suffolk', 'appinc','typur','unit','married','dep','emp',yjob','self','atotinc','cototinc','hexp']

      # from azureml import Workspace
      # ws = Workspace(
      # workspace_id='',
      # authorization_token='==',
      # endpoint='https://studioapi.azureml.net'
      # )
      # ds = ws.datasets['loanapp_c.csv']

      ds = pd.read_csv('desktop/python ML/loanapp_c.csv')
      dataset = ds.to_dataframe()


      I was running this on Azure and am now trying to do it locally. Here is the error I'm getting:



      AttributeError                Traceback (most recent call last)
      <ipython-input-3-b49a23658806> in <module>()
      32
      33 ds = pd.read_csv('desktop/python ML/loanapp_c.csv')
      ---> 34 dataset = ds.to_dataframe()
      35
      36 # shape

      ~/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py in_getattr_(self, name)
      4374 if self._info_axis.can_hold_identifiers_and_holds_name(name):
      return self[name]
      -> 4376 return object._getattribute_(self,name)
      4377
      4378 def _setattr_(self, name, value):

      AttributeError: 'DataFrame' object has no attribute 'to_dataframe'


      Not sure what I have wrong.










      share|improve this question







      New contributor




      user68346 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      $endgroup$




      I'm sure I have a small error here that I'm overlooking, but am having a tough time figuring out what I need to change.



      Here is my code up until the error I'm getting.



      # Load libraries
      import pandas as pd
      import numpy as np
      from pandas.tools.plotting import scatter_matrix
      import matplotlib.pyplot as plt
      from sklearn import model_selection
      from sklearn.metrics import classification_report
      from sklearn.metrics import confusion_matrix
      from sklearn.metrics import accuracy_score
      from sklearn.linear_model import LogisticRegression
      from sklearn.tree import DecisionTreeClassifier
      from sklearn.neighbors import KNeighborsClassifier
      from sklearn.discriminant_analyisis import LinearDiscriminantAnalysis
      from sklearn.naive_bayes import GaussianNB
      from sklearn.svm import SVC

      # Load dataset
      names = ['action','reject','approve','occ','loanamt', 'suffolk', 'appinc','typur','unit','married','dep','emp',yjob','self','atotinc','cototinc','hexp']

      # from azureml import Workspace
      # ws = Workspace(
      # workspace_id='',
      # authorization_token='==',
      # endpoint='https://studioapi.azureml.net'
      # )
      # ds = ws.datasets['loanapp_c.csv']

      ds = pd.read_csv('desktop/python ML/loanapp_c.csv')
      dataset = ds.to_dataframe()


      I was running this on Azure and am now trying to do it locally. Here is the error I'm getting:



      AttributeError                Traceback (most recent call last)
      <ipython-input-3-b49a23658806> in <module>()
      32
      33 ds = pd.read_csv('desktop/python ML/loanapp_c.csv')
      ---> 34 dataset = ds.to_dataframe()
      35
      36 # shape

      ~/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py in_getattr_(self, name)
      4374 if self._info_axis.can_hold_identifiers_and_holds_name(name):
      return self[name]
      -> 4376 return object._getattribute_(self,name)
      4377
      4378 def _setattr_(self, name, value):

      AttributeError: 'DataFrame' object has no attribute 'to_dataframe'


      Not sure what I have wrong.







      dataframe






      share|improve this question







      New contributor




      user68346 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      user68346 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      user68346 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      user68346user68346

      31




      31




      New contributor




      user68346 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      user68346 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      user68346 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          2 Answers
          2






          active

          oldest

          votes


















          1












          $begingroup$

          The function pd.read_csv() is already a DataFrame and thus that kind of object does not support calling .to_dataframe().



          You can check the type of your variable ds using print(type(ds)), you will see that it is a pandas DataFrame type.






          share|improve this answer









          $endgroup$





















            1












            $begingroup$

            According to what I understand. You are loading loanapp_c.csv in ds using this code:



            ds = pd.read_csv('desktop/python ML/loanapp_c.csv')


            ds over here is a DataFrame object. What you are doing is calling to_dataframe on an object which a DataFrame already.



            Removing this dataset = ds.to_dataframe() from your code should solve the error






            share|improve this answer








            New contributor




            Dhaval Thakkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.






            $endgroup$













            • $begingroup$
              I just set dataset = ds and that fixed it. Thanks for your help!
              $endgroup$
              – user68346
              56 mins ago











            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "557"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });






            user68346 is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46149%2fdataframe-object-has-no-attribute-to-dataframe%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1












            $begingroup$

            The function pd.read_csv() is already a DataFrame and thus that kind of object does not support calling .to_dataframe().



            You can check the type of your variable ds using print(type(ds)), you will see that it is a pandas DataFrame type.






            share|improve this answer









            $endgroup$


















              1












              $begingroup$

              The function pd.read_csv() is already a DataFrame and thus that kind of object does not support calling .to_dataframe().



              You can check the type of your variable ds using print(type(ds)), you will see that it is a pandas DataFrame type.






              share|improve this answer









              $endgroup$
















                1












                1








                1





                $begingroup$

                The function pd.read_csv() is already a DataFrame and thus that kind of object does not support calling .to_dataframe().



                You can check the type of your variable ds using print(type(ds)), you will see that it is a pandas DataFrame type.






                share|improve this answer









                $endgroup$



                The function pd.read_csv() is already a DataFrame and thus that kind of object does not support calling .to_dataframe().



                You can check the type of your variable ds using print(type(ds)), you will see that it is a pandas DataFrame type.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 1 hour ago









                JahKnowsJahKnows

                4,772525




                4,772525























                    1












                    $begingroup$

                    According to what I understand. You are loading loanapp_c.csv in ds using this code:



                    ds = pd.read_csv('desktop/python ML/loanapp_c.csv')


                    ds over here is a DataFrame object. What you are doing is calling to_dataframe on an object which a DataFrame already.



                    Removing this dataset = ds.to_dataframe() from your code should solve the error






                    share|improve this answer








                    New contributor




                    Dhaval Thakkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.






                    $endgroup$













                    • $begingroup$
                      I just set dataset = ds and that fixed it. Thanks for your help!
                      $endgroup$
                      – user68346
                      56 mins ago
















                    1












                    $begingroup$

                    According to what I understand. You are loading loanapp_c.csv in ds using this code:



                    ds = pd.read_csv('desktop/python ML/loanapp_c.csv')


                    ds over here is a DataFrame object. What you are doing is calling to_dataframe on an object which a DataFrame already.



                    Removing this dataset = ds.to_dataframe() from your code should solve the error






                    share|improve this answer








                    New contributor




                    Dhaval Thakkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.






                    $endgroup$













                    • $begingroup$
                      I just set dataset = ds and that fixed it. Thanks for your help!
                      $endgroup$
                      – user68346
                      56 mins ago














                    1












                    1








                    1





                    $begingroup$

                    According to what I understand. You are loading loanapp_c.csv in ds using this code:



                    ds = pd.read_csv('desktop/python ML/loanapp_c.csv')


                    ds over here is a DataFrame object. What you are doing is calling to_dataframe on an object which a DataFrame already.



                    Removing this dataset = ds.to_dataframe() from your code should solve the error






                    share|improve this answer








                    New contributor




                    Dhaval Thakkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.






                    $endgroup$



                    According to what I understand. You are loading loanapp_c.csv in ds using this code:



                    ds = pd.read_csv('desktop/python ML/loanapp_c.csv')


                    ds over here is a DataFrame object. What you are doing is calling to_dataframe on an object which a DataFrame already.



                    Removing this dataset = ds.to_dataframe() from your code should solve the error







                    share|improve this answer








                    New contributor




                    Dhaval Thakkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    share|improve this answer



                    share|improve this answer






                    New contributor




                    Dhaval Thakkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    answered 1 hour ago









                    Dhaval ThakkarDhaval Thakkar

                    135




                    135




                    New contributor




                    Dhaval Thakkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.





                    New contributor





                    Dhaval Thakkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.






                    Dhaval Thakkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.












                    • $begingroup$
                      I just set dataset = ds and that fixed it. Thanks for your help!
                      $endgroup$
                      – user68346
                      56 mins ago


















                    • $begingroup$
                      I just set dataset = ds and that fixed it. Thanks for your help!
                      $endgroup$
                      – user68346
                      56 mins ago
















                    $begingroup$
                    I just set dataset = ds and that fixed it. Thanks for your help!
                    $endgroup$
                    – user68346
                    56 mins ago




                    $begingroup$
                    I just set dataset = ds and that fixed it. Thanks for your help!
                    $endgroup$
                    – user68346
                    56 mins ago










                    user68346 is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded


















                    user68346 is a new contributor. Be nice, and check out our Code of Conduct.













                    user68346 is a new contributor. Be nice, and check out our Code of Conduct.












                    user68346 is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Data Science Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f46149%2fdataframe-object-has-no-attribute-to-dataframe%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Szabolcs (Ungheria) Altri progetti | Menu di navigazione48°10′14.56″N 21°29′33.14″E /...

                    Discografia di Klaus Schulze Indice Album in studio | Album dal vivo | Singoli | Antologie | Colonne...

                    How to make inet_server_addr() return localhost in spite of ::1/128RETURN NEXT in Postgres FunctionConnect to...