'Series' object has no attribute 'flatten' when I use y.flatten()



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-3















I am stuck here since last night everything was working just fine and now this.



May I know what the bug is?



Its just frustrating.



I am trying to implement sigmoid function for a give data set.



I want to change its orientation basically for theat I have used y.flatten which is giving me above mentioned error.










share|improve this question
























  • Hi and welcome to Stack Overflow :). Please show us your code and explain your issue more detailed. Thanks!

    – CodeF0x
    Nov 15 '18 at 12:51











  • We can't see your code.

    – timgeb
    Nov 15 '18 at 12:52

















-3















I am stuck here since last night everything was working just fine and now this.



May I know what the bug is?



Its just frustrating.



I am trying to implement sigmoid function for a give data set.



I want to change its orientation basically for theat I have used y.flatten which is giving me above mentioned error.










share|improve this question
























  • Hi and welcome to Stack Overflow :). Please show us your code and explain your issue more detailed. Thanks!

    – CodeF0x
    Nov 15 '18 at 12:51











  • We can't see your code.

    – timgeb
    Nov 15 '18 at 12:52













-3












-3








-3








I am stuck here since last night everything was working just fine and now this.



May I know what the bug is?



Its just frustrating.



I am trying to implement sigmoid function for a give data set.



I want to change its orientation basically for theat I have used y.flatten which is giving me above mentioned error.










share|improve this question
















I am stuck here since last night everything was working just fine and now this.



May I know what the bug is?



Its just frustrating.



I am trying to implement sigmoid function for a give data set.



I want to change its orientation basically for theat I have used y.flatten which is giving me above mentioned error.







python






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 12:57







Sarthak Bhatia

















asked Nov 15 '18 at 12:50









Sarthak BhatiaSarthak Bhatia

11




11












  • Hi and welcome to Stack Overflow :). Please show us your code and explain your issue more detailed. Thanks!

    – CodeF0x
    Nov 15 '18 at 12:51











  • We can't see your code.

    – timgeb
    Nov 15 '18 at 12:52

















  • Hi and welcome to Stack Overflow :). Please show us your code and explain your issue more detailed. Thanks!

    – CodeF0x
    Nov 15 '18 at 12:51











  • We can't see your code.

    – timgeb
    Nov 15 '18 at 12:52
















Hi and welcome to Stack Overflow :). Please show us your code and explain your issue more detailed. Thanks!

– CodeF0x
Nov 15 '18 at 12:51





Hi and welcome to Stack Overflow :). Please show us your code and explain your issue more detailed. Thanks!

– CodeF0x
Nov 15 '18 at 12:51













We can't see your code.

– timgeb
Nov 15 '18 at 12:52





We can't see your code.

– timgeb
Nov 15 '18 at 12:52












1 Answer
1






active

oldest

votes


















2














flatten is a method of np.array not of pd.Series.



Try



y.values.flatten()





share|improve this answer























  • I never created a pd.series actually its an output of regression. It was an array earlier. I don't know why it has turned into a pd.series. Is there a way to make it an array? Because I have to use it to implement MSE. Thanks

    – Sarthak Bhatia
    Nov 15 '18 at 12:58











  • yes, via the values property. y.values contains the values of a Series and is of type numpy.ndarray

    – SpghttCd
    Nov 15 '18 at 13:31







  • 1





    If you provide the relevant code, people could give you hints about why's and even can point you to alternatives of things you could do better even if you didn't address them directly. But if you only talk about things you do somehow and basically post only an error message, people have to guess what you perhaps might mean/do/know/plan/discover/want...., which is inefficient.

    – SpghttCd
    Nov 15 '18 at 13:36












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53319865%2fseries-object-has-no-attribute-flatten-when-i-use-y-flatten%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














flatten is a method of np.array not of pd.Series.



Try



y.values.flatten()





share|improve this answer























  • I never created a pd.series actually its an output of regression. It was an array earlier. I don't know why it has turned into a pd.series. Is there a way to make it an array? Because I have to use it to implement MSE. Thanks

    – Sarthak Bhatia
    Nov 15 '18 at 12:58











  • yes, via the values property. y.values contains the values of a Series and is of type numpy.ndarray

    – SpghttCd
    Nov 15 '18 at 13:31







  • 1





    If you provide the relevant code, people could give you hints about why's and even can point you to alternatives of things you could do better even if you didn't address them directly. But if you only talk about things you do somehow and basically post only an error message, people have to guess what you perhaps might mean/do/know/plan/discover/want...., which is inefficient.

    – SpghttCd
    Nov 15 '18 at 13:36
















2














flatten is a method of np.array not of pd.Series.



Try



y.values.flatten()





share|improve this answer























  • I never created a pd.series actually its an output of regression. It was an array earlier. I don't know why it has turned into a pd.series. Is there a way to make it an array? Because I have to use it to implement MSE. Thanks

    – Sarthak Bhatia
    Nov 15 '18 at 12:58











  • yes, via the values property. y.values contains the values of a Series and is of type numpy.ndarray

    – SpghttCd
    Nov 15 '18 at 13:31







  • 1





    If you provide the relevant code, people could give you hints about why's and even can point you to alternatives of things you could do better even if you didn't address them directly. But if you only talk about things you do somehow and basically post only an error message, people have to guess what you perhaps might mean/do/know/plan/discover/want...., which is inefficient.

    – SpghttCd
    Nov 15 '18 at 13:36














2












2








2







flatten is a method of np.array not of pd.Series.



Try



y.values.flatten()





share|improve this answer













flatten is a method of np.array not of pd.Series.



Try



y.values.flatten()






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 15 '18 at 12:52









SpghttCdSpghttCd

5,3152415




5,3152415












  • I never created a pd.series actually its an output of regression. It was an array earlier. I don't know why it has turned into a pd.series. Is there a way to make it an array? Because I have to use it to implement MSE. Thanks

    – Sarthak Bhatia
    Nov 15 '18 at 12:58











  • yes, via the values property. y.values contains the values of a Series and is of type numpy.ndarray

    – SpghttCd
    Nov 15 '18 at 13:31







  • 1





    If you provide the relevant code, people could give you hints about why's and even can point you to alternatives of things you could do better even if you didn't address them directly. But if you only talk about things you do somehow and basically post only an error message, people have to guess what you perhaps might mean/do/know/plan/discover/want...., which is inefficient.

    – SpghttCd
    Nov 15 '18 at 13:36


















  • I never created a pd.series actually its an output of regression. It was an array earlier. I don't know why it has turned into a pd.series. Is there a way to make it an array? Because I have to use it to implement MSE. Thanks

    – Sarthak Bhatia
    Nov 15 '18 at 12:58











  • yes, via the values property. y.values contains the values of a Series and is of type numpy.ndarray

    – SpghttCd
    Nov 15 '18 at 13:31







  • 1





    If you provide the relevant code, people could give you hints about why's and even can point you to alternatives of things you could do better even if you didn't address them directly. But if you only talk about things you do somehow and basically post only an error message, people have to guess what you perhaps might mean/do/know/plan/discover/want...., which is inefficient.

    – SpghttCd
    Nov 15 '18 at 13:36

















I never created a pd.series actually its an output of regression. It was an array earlier. I don't know why it has turned into a pd.series. Is there a way to make it an array? Because I have to use it to implement MSE. Thanks

– Sarthak Bhatia
Nov 15 '18 at 12:58





I never created a pd.series actually its an output of regression. It was an array earlier. I don't know why it has turned into a pd.series. Is there a way to make it an array? Because I have to use it to implement MSE. Thanks

– Sarthak Bhatia
Nov 15 '18 at 12:58













yes, via the values property. y.values contains the values of a Series and is of type numpy.ndarray

– SpghttCd
Nov 15 '18 at 13:31






yes, via the values property. y.values contains the values of a Series and is of type numpy.ndarray

– SpghttCd
Nov 15 '18 at 13:31





1




1





If you provide the relevant code, people could give you hints about why's and even can point you to alternatives of things you could do better even if you didn't address them directly. But if you only talk about things you do somehow and basically post only an error message, people have to guess what you perhaps might mean/do/know/plan/discover/want...., which is inefficient.

– SpghttCd
Nov 15 '18 at 13:36






If you provide the relevant code, people could give you hints about why's and even can point you to alternatives of things you could do better even if you didn't address them directly. But if you only talk about things you do somehow and basically post only an error message, people have to guess what you perhaps might mean/do/know/plan/discover/want...., which is inefficient.

– SpghttCd
Nov 15 '18 at 13:36




















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • 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.

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%2fstackoverflow.com%2fquestions%2f53319865%2fseries-object-has-no-attribute-flatten-when-i-use-y-flatten%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

Use pre created SQLite database for Android project in kotlin

Darth Vader #20

Ondo