'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;
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
add a comment |
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
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
add a comment |
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
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
python
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
flatten
is a method of np.array
not of pd.Series
.
Try
y.values.flatten()
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 aSeries
and is of typenumpy.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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
flatten
is a method of np.array
not of pd.Series
.
Try
y.values.flatten()
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 aSeries
and is of typenumpy.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
add a comment |
flatten
is a method of np.array
not of pd.Series
.
Try
y.values.flatten()
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 aSeries
and is of typenumpy.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
add a comment |
flatten
is a method of np.array
not of pd.Series
.
Try
y.values.flatten()
flatten
is a method of np.array
not of pd.Series
.
Try
y.values.flatten()
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 aSeries
and is of typenumpy.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
add a comment |
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 aSeries
and is of typenumpy.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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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