How can the property list of interpolating function be explored and exploited?
$begingroup$
While looking at this question, I asked myself the question given in the title. I post the results of my investigation in the question as an answer.
I used the example code given in the referenced question to carry out my investigation.
properties
$endgroup$
add a comment |
$begingroup$
While looking at this question, I asked myself the question given in the title. I post the results of my investigation in the question as an answer.
I used the example code given in the referenced question to carry out my investigation.
properties
$endgroup$
add a comment |
$begingroup$
While looking at this question, I asked myself the question given in the title. I post the results of my investigation in the question as an answer.
I used the example code given in the referenced question to carry out my investigation.
properties
$endgroup$
While looking at this question, I asked myself the question given in the title. I post the results of my investigation in the question as an answer.
I used the example code given in the referenced question to carry out my investigation.
properties
properties
asked 5 hours ago
m_goldbergm_goldberg
85.9k872196
85.9k872196
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
pts = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};
f = Interpolation[pts]
I extracted the property values from the property list with PropertyValue
and made an association with the properties names as keys for ease of examination and access.
propAssoc = Association[{# -> PropertyValue[f, #]} & /@ PropertyList[f]]
The association can be queried to get individual property values.
propAssoc @ "Domain"
{{0, 5}}
but, of course, if we don't want the bother of making an association just to get one or a few property values, we can use
PropertyValue[f, "Domain"]
{{0, 5}}
which seems always to be safe.
However, be aware that f
itself acts like an association when given a valid property name and, also being safe, should probably be considered the standard practice for accessing properties.
f @ "Domain"
{{0, 5}}
$endgroup$
$begingroup$
Is this meant to be sort of a canonical question/answer that we can point to whenever someone is wondering how to extract information from anInterpolatingFunction
? And, if so, isn't the canonical answer just your very last paragraph?
$endgroup$
– march
5 hours ago
$begingroup$
@march I didn't intend for it a canonical question but as an example of how to go about finding and using the properties of functions that have them. If it is useful as a canonical that'a a bonus. However, I think the 1st part, about how extract info on the properties, is as useful as the final conclusion.
$endgroup$
– m_goldberg
4 hours ago
$begingroup$
I mean, I definitely like theAssociation
construction, since it has both the possible property names and their values all in one object, easily accessible and readable (rather than having to remember what properties there are). So, I get it!
$endgroup$
– march
4 hours ago
add a comment |
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: "387"
};
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
});
}
});
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%2fmathematica.stackexchange.com%2fquestions%2f191161%2fhow-can-the-property-list-of-interpolating-function-be-explored-and-exploited%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
$begingroup$
pts = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};
f = Interpolation[pts]
I extracted the property values from the property list with PropertyValue
and made an association with the properties names as keys for ease of examination and access.
propAssoc = Association[{# -> PropertyValue[f, #]} & /@ PropertyList[f]]
The association can be queried to get individual property values.
propAssoc @ "Domain"
{{0, 5}}
but, of course, if we don't want the bother of making an association just to get one or a few property values, we can use
PropertyValue[f, "Domain"]
{{0, 5}}
which seems always to be safe.
However, be aware that f
itself acts like an association when given a valid property name and, also being safe, should probably be considered the standard practice for accessing properties.
f @ "Domain"
{{0, 5}}
$endgroup$
$begingroup$
Is this meant to be sort of a canonical question/answer that we can point to whenever someone is wondering how to extract information from anInterpolatingFunction
? And, if so, isn't the canonical answer just your very last paragraph?
$endgroup$
– march
5 hours ago
$begingroup$
@march I didn't intend for it a canonical question but as an example of how to go about finding and using the properties of functions that have them. If it is useful as a canonical that'a a bonus. However, I think the 1st part, about how extract info on the properties, is as useful as the final conclusion.
$endgroup$
– m_goldberg
4 hours ago
$begingroup$
I mean, I definitely like theAssociation
construction, since it has both the possible property names and their values all in one object, easily accessible and readable (rather than having to remember what properties there are). So, I get it!
$endgroup$
– march
4 hours ago
add a comment |
$begingroup$
pts = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};
f = Interpolation[pts]
I extracted the property values from the property list with PropertyValue
and made an association with the properties names as keys for ease of examination and access.
propAssoc = Association[{# -> PropertyValue[f, #]} & /@ PropertyList[f]]
The association can be queried to get individual property values.
propAssoc @ "Domain"
{{0, 5}}
but, of course, if we don't want the bother of making an association just to get one or a few property values, we can use
PropertyValue[f, "Domain"]
{{0, 5}}
which seems always to be safe.
However, be aware that f
itself acts like an association when given a valid property name and, also being safe, should probably be considered the standard practice for accessing properties.
f @ "Domain"
{{0, 5}}
$endgroup$
$begingroup$
Is this meant to be sort of a canonical question/answer that we can point to whenever someone is wondering how to extract information from anInterpolatingFunction
? And, if so, isn't the canonical answer just your very last paragraph?
$endgroup$
– march
5 hours ago
$begingroup$
@march I didn't intend for it a canonical question but as an example of how to go about finding and using the properties of functions that have them. If it is useful as a canonical that'a a bonus. However, I think the 1st part, about how extract info on the properties, is as useful as the final conclusion.
$endgroup$
– m_goldberg
4 hours ago
$begingroup$
I mean, I definitely like theAssociation
construction, since it has both the possible property names and their values all in one object, easily accessible and readable (rather than having to remember what properties there are). So, I get it!
$endgroup$
– march
4 hours ago
add a comment |
$begingroup$
pts = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};
f = Interpolation[pts]
I extracted the property values from the property list with PropertyValue
and made an association with the properties names as keys for ease of examination and access.
propAssoc = Association[{# -> PropertyValue[f, #]} & /@ PropertyList[f]]
The association can be queried to get individual property values.
propAssoc @ "Domain"
{{0, 5}}
but, of course, if we don't want the bother of making an association just to get one or a few property values, we can use
PropertyValue[f, "Domain"]
{{0, 5}}
which seems always to be safe.
However, be aware that f
itself acts like an association when given a valid property name and, also being safe, should probably be considered the standard practice for accessing properties.
f @ "Domain"
{{0, 5}}
$endgroup$
pts = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}};
f = Interpolation[pts]
I extracted the property values from the property list with PropertyValue
and made an association with the properties names as keys for ease of examination and access.
propAssoc = Association[{# -> PropertyValue[f, #]} & /@ PropertyList[f]]
The association can be queried to get individual property values.
propAssoc @ "Domain"
{{0, 5}}
but, of course, if we don't want the bother of making an association just to get one or a few property values, we can use
PropertyValue[f, "Domain"]
{{0, 5}}
which seems always to be safe.
However, be aware that f
itself acts like an association when given a valid property name and, also being safe, should probably be considered the standard practice for accessing properties.
f @ "Domain"
{{0, 5}}
answered 5 hours ago
m_goldbergm_goldberg
85.9k872196
85.9k872196
$begingroup$
Is this meant to be sort of a canonical question/answer that we can point to whenever someone is wondering how to extract information from anInterpolatingFunction
? And, if so, isn't the canonical answer just your very last paragraph?
$endgroup$
– march
5 hours ago
$begingroup$
@march I didn't intend for it a canonical question but as an example of how to go about finding and using the properties of functions that have them. If it is useful as a canonical that'a a bonus. However, I think the 1st part, about how extract info on the properties, is as useful as the final conclusion.
$endgroup$
– m_goldberg
4 hours ago
$begingroup$
I mean, I definitely like theAssociation
construction, since it has both the possible property names and their values all in one object, easily accessible and readable (rather than having to remember what properties there are). So, I get it!
$endgroup$
– march
4 hours ago
add a comment |
$begingroup$
Is this meant to be sort of a canonical question/answer that we can point to whenever someone is wondering how to extract information from anInterpolatingFunction
? And, if so, isn't the canonical answer just your very last paragraph?
$endgroup$
– march
5 hours ago
$begingroup$
@march I didn't intend for it a canonical question but as an example of how to go about finding and using the properties of functions that have them. If it is useful as a canonical that'a a bonus. However, I think the 1st part, about how extract info on the properties, is as useful as the final conclusion.
$endgroup$
– m_goldberg
4 hours ago
$begingroup$
I mean, I definitely like theAssociation
construction, since it has both the possible property names and their values all in one object, easily accessible and readable (rather than having to remember what properties there are). So, I get it!
$endgroup$
– march
4 hours ago
$begingroup$
Is this meant to be sort of a canonical question/answer that we can point to whenever someone is wondering how to extract information from an
InterpolatingFunction
? And, if so, isn't the canonical answer just your very last paragraph?$endgroup$
– march
5 hours ago
$begingroup$
Is this meant to be sort of a canonical question/answer that we can point to whenever someone is wondering how to extract information from an
InterpolatingFunction
? And, if so, isn't the canonical answer just your very last paragraph?$endgroup$
– march
5 hours ago
$begingroup$
@march I didn't intend for it a canonical question but as an example of how to go about finding and using the properties of functions that have them. If it is useful as a canonical that'a a bonus. However, I think the 1st part, about how extract info on the properties, is as useful as the final conclusion.
$endgroup$
– m_goldberg
4 hours ago
$begingroup$
@march I didn't intend for it a canonical question but as an example of how to go about finding and using the properties of functions that have them. If it is useful as a canonical that'a a bonus. However, I think the 1st part, about how extract info on the properties, is as useful as the final conclusion.
$endgroup$
– m_goldberg
4 hours ago
$begingroup$
I mean, I definitely like the
Association
construction, since it has both the possible property names and their values all in one object, easily accessible and readable (rather than having to remember what properties there are). So, I get it!$endgroup$
– march
4 hours ago
$begingroup$
I mean, I definitely like the
Association
construction, since it has both the possible property names and their values all in one object, easily accessible and readable (rather than having to remember what properties there are). So, I get it!$endgroup$
– march
4 hours ago
add a comment |
Thanks for contributing an answer to Mathematica 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.
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%2fmathematica.stackexchange.com%2fquestions%2f191161%2fhow-can-the-property-list-of-interpolating-function-be-explored-and-exploited%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