Deleting missing values from a datasetHow to execute JavaScipt on a webpage and then import the result on...

What was this official D&D 3.5e Lovecraft-flavored rulebook?

Is it possible to put a rectangle as background in the author section?

Calculating Wattage for Resistor in High Frequency Application?

Non-trope happy ending?

Offered money to buy a house, seller is asking for more to cover gap between their listing and mortgage owed

Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?

How to explain what's wrong with this application of the chain rule?

Should I stop contributing to retirement accounts?

why `nmap 192.168.1.97` returns less services than `nmap 127.0.0.1`?

How to indicate a cut out for a product window

When were female captains banned from Starfleet?

What does routing an IP address mean?

How to implement a feedback to keep the DC gain at zero for this conceptual passive filter?

How should I respond when I lied about my education and the company finds out through background check?

It grows, but water kills it

How could a planet have erratic days?

Why should universal income be universal?

Travelling outside the UK without a passport

Creature in Shazam mid-credits scene?

Longest common substring in linear time

250 Floor Tower

What should you do when eye contact makes your subordinate uncomfortable?

Why electric field inside a cavity of a non-conducting sphere not zero?

What is this called? Old film camera viewer?



Deleting missing values from a dataset


How to execute JavaScipt on a webpage and then import the result on OSX?GeoLabels/Tooltips in Geographic Plots from DatasetImport a column of data, make a matrix from it and export it WITHOUT curly bracesShort way to query Dataset by the value of several columnsHow do I import a Dataset that contains lists?Going from Dataset back to underlying AssociationsElegant way to return first non-Missing column in DatasetHow to work with a Dataset?Best way to convert numerical columns of a dataset with missing values into a matrixWhat's the best way to import such dataset?













2












$begingroup$


I wanted to create a dataset of all UFO sightings in April of 2018. The
AssociationThread doesn't want to work, because some of the entries are missing value, what is the best way to fix it?



dataA1 = Import[
"http://www.nuforc.org/webreports/ndxe201804.html", {"HTML",
"Data"}];
dataA2 = Flatten[Rest@dataA1, 1];
dataA3 =
Map[AssociationThread[First[dataA1], #] &, dataA2]
Dataset[dataA3]









share|improve this question











$endgroup$








  • 1




    $begingroup$
    To be clear, this isn't about data that is Missing[], but rather Import[XXXX,{"HTML", "Data"}] giving "tables" that have rows with inconsistent lengths.
    $endgroup$
    – Carl Lange
    Mar 13 at 20:52
















2












$begingroup$


I wanted to create a dataset of all UFO sightings in April of 2018. The
AssociationThread doesn't want to work, because some of the entries are missing value, what is the best way to fix it?



dataA1 = Import[
"http://www.nuforc.org/webreports/ndxe201804.html", {"HTML",
"Data"}];
dataA2 = Flatten[Rest@dataA1, 1];
dataA3 =
Map[AssociationThread[First[dataA1], #] &, dataA2]
Dataset[dataA3]









share|improve this question











$endgroup$








  • 1




    $begingroup$
    To be clear, this isn't about data that is Missing[], but rather Import[XXXX,{"HTML", "Data"}] giving "tables" that have rows with inconsistent lengths.
    $endgroup$
    – Carl Lange
    Mar 13 at 20:52














2












2








2





$begingroup$


I wanted to create a dataset of all UFO sightings in April of 2018. The
AssociationThread doesn't want to work, because some of the entries are missing value, what is the best way to fix it?



dataA1 = Import[
"http://www.nuforc.org/webreports/ndxe201804.html", {"HTML",
"Data"}];
dataA2 = Flatten[Rest@dataA1, 1];
dataA3 =
Map[AssociationThread[First[dataA1], #] &, dataA2]
Dataset[dataA3]









share|improve this question











$endgroup$




I wanted to create a dataset of all UFO sightings in April of 2018. The
AssociationThread doesn't want to work, because some of the entries are missing value, what is the best way to fix it?



dataA1 = Import[
"http://www.nuforc.org/webreports/ndxe201804.html", {"HTML",
"Data"}];
dataA2 = Flatten[Rest@dataA1, 1];
dataA3 =
Map[AssociationThread[First[dataA1], #] &, dataA2]
Dataset[dataA3]






import dataset associations web-access






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 13 at 22:44









Carl Lange

4,96211141




4,96211141










asked Mar 13 at 20:45









Artem AnisimovArtem Anisimov

403




403








  • 1




    $begingroup$
    To be clear, this isn't about data that is Missing[], but rather Import[XXXX,{"HTML", "Data"}] giving "tables" that have rows with inconsistent lengths.
    $endgroup$
    – Carl Lange
    Mar 13 at 20:52














  • 1




    $begingroup$
    To be clear, this isn't about data that is Missing[], but rather Import[XXXX,{"HTML", "Data"}] giving "tables" that have rows with inconsistent lengths.
    $endgroup$
    – Carl Lange
    Mar 13 at 20:52








1




1




$begingroup$
To be clear, this isn't about data that is Missing[], but rather Import[XXXX,{"HTML", "Data"}] giving "tables" that have rows with inconsistent lengths.
$endgroup$
– Carl Lange
Mar 13 at 20:52




$begingroup$
To be clear, this isn't about data that is Missing[], but rather Import[XXXX,{"HTML", "Data"}] giving "tables" that have rows with inconsistent lengths.
$endgroup$
– Carl Lange
Mar 13 at 20:52










1 Answer
1






active

oldest

votes


















6












$begingroup$

You can solve this by importing "FullData" rather than "Data".



dataA1 = Import[
"http://www.nuforc.org/webreports/ndxe201804.html", {"HTML",
"FullData"}]
dataA2 = Flatten[Most@Rest@dataA1[[8]], 1]
dataA3 = Map[AssociationThread[dataA1[[8, 1, 1]], #] &, dataA2];
Dataset[dataA3]


What's awkward about this is that there can be many empty tables that you must sift through (as you can see, I have to get the 8th element). However, it works quite well in this case.






share|improve this answer









$endgroup$













  • $begingroup$
    Thank you, but I'm not completely sure how "Data" and "FullData" differ. Why do they exist separately?
    $endgroup$
    – Artem Anisimov
    Mar 13 at 21:45






  • 2




    $begingroup$
    @ArtemAnisimov From the documentation for the "HTML" import/export format: "FullData" imports: "full tabular content, including empty HTML table and list elements". "Data" doesn't import empty elements.
    $endgroup$
    – Carl Lange
    Mar 13 at 22:28











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193199%2fdeleting-missing-values-from-a-dataset%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









6












$begingroup$

You can solve this by importing "FullData" rather than "Data".



dataA1 = Import[
"http://www.nuforc.org/webreports/ndxe201804.html", {"HTML",
"FullData"}]
dataA2 = Flatten[Most@Rest@dataA1[[8]], 1]
dataA3 = Map[AssociationThread[dataA1[[8, 1, 1]], #] &, dataA2];
Dataset[dataA3]


What's awkward about this is that there can be many empty tables that you must sift through (as you can see, I have to get the 8th element). However, it works quite well in this case.






share|improve this answer









$endgroup$













  • $begingroup$
    Thank you, but I'm not completely sure how "Data" and "FullData" differ. Why do they exist separately?
    $endgroup$
    – Artem Anisimov
    Mar 13 at 21:45






  • 2




    $begingroup$
    @ArtemAnisimov From the documentation for the "HTML" import/export format: "FullData" imports: "full tabular content, including empty HTML table and list elements". "Data" doesn't import empty elements.
    $endgroup$
    – Carl Lange
    Mar 13 at 22:28
















6












$begingroup$

You can solve this by importing "FullData" rather than "Data".



dataA1 = Import[
"http://www.nuforc.org/webreports/ndxe201804.html", {"HTML",
"FullData"}]
dataA2 = Flatten[Most@Rest@dataA1[[8]], 1]
dataA3 = Map[AssociationThread[dataA1[[8, 1, 1]], #] &, dataA2];
Dataset[dataA3]


What's awkward about this is that there can be many empty tables that you must sift through (as you can see, I have to get the 8th element). However, it works quite well in this case.






share|improve this answer









$endgroup$













  • $begingroup$
    Thank you, but I'm not completely sure how "Data" and "FullData" differ. Why do they exist separately?
    $endgroup$
    – Artem Anisimov
    Mar 13 at 21:45






  • 2




    $begingroup$
    @ArtemAnisimov From the documentation for the "HTML" import/export format: "FullData" imports: "full tabular content, including empty HTML table and list elements". "Data" doesn't import empty elements.
    $endgroup$
    – Carl Lange
    Mar 13 at 22:28














6












6








6





$begingroup$

You can solve this by importing "FullData" rather than "Data".



dataA1 = Import[
"http://www.nuforc.org/webreports/ndxe201804.html", {"HTML",
"FullData"}]
dataA2 = Flatten[Most@Rest@dataA1[[8]], 1]
dataA3 = Map[AssociationThread[dataA1[[8, 1, 1]], #] &, dataA2];
Dataset[dataA3]


What's awkward about this is that there can be many empty tables that you must sift through (as you can see, I have to get the 8th element). However, it works quite well in this case.






share|improve this answer









$endgroup$



You can solve this by importing "FullData" rather than "Data".



dataA1 = Import[
"http://www.nuforc.org/webreports/ndxe201804.html", {"HTML",
"FullData"}]
dataA2 = Flatten[Most@Rest@dataA1[[8]], 1]
dataA3 = Map[AssociationThread[dataA1[[8, 1, 1]], #] &, dataA2];
Dataset[dataA3]


What's awkward about this is that there can be many empty tables that you must sift through (as you can see, I have to get the 8th element). However, it works quite well in this case.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 13 at 21:08









Carl LangeCarl Lange

4,96211141




4,96211141












  • $begingroup$
    Thank you, but I'm not completely sure how "Data" and "FullData" differ. Why do they exist separately?
    $endgroup$
    – Artem Anisimov
    Mar 13 at 21:45






  • 2




    $begingroup$
    @ArtemAnisimov From the documentation for the "HTML" import/export format: "FullData" imports: "full tabular content, including empty HTML table and list elements". "Data" doesn't import empty elements.
    $endgroup$
    – Carl Lange
    Mar 13 at 22:28


















  • $begingroup$
    Thank you, but I'm not completely sure how "Data" and "FullData" differ. Why do they exist separately?
    $endgroup$
    – Artem Anisimov
    Mar 13 at 21:45






  • 2




    $begingroup$
    @ArtemAnisimov From the documentation for the "HTML" import/export format: "FullData" imports: "full tabular content, including empty HTML table and list elements". "Data" doesn't import empty elements.
    $endgroup$
    – Carl Lange
    Mar 13 at 22:28
















$begingroup$
Thank you, but I'm not completely sure how "Data" and "FullData" differ. Why do they exist separately?
$endgroup$
– Artem Anisimov
Mar 13 at 21:45




$begingroup$
Thank you, but I'm not completely sure how "Data" and "FullData" differ. Why do they exist separately?
$endgroup$
– Artem Anisimov
Mar 13 at 21:45




2




2




$begingroup$
@ArtemAnisimov From the documentation for the "HTML" import/export format: "FullData" imports: "full tabular content, including empty HTML table and list elements". "Data" doesn't import empty elements.
$endgroup$
– Carl Lange
Mar 13 at 22:28




$begingroup$
@ArtemAnisimov From the documentation for the "HTML" import/export format: "FullData" imports: "full tabular content, including empty HTML table and list elements". "Data" doesn't import empty elements.
$endgroup$
– Carl Lange
Mar 13 at 22:28


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193199%2fdeleting-missing-values-from-a-dataset%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

Nidaros erkebispedøme

Birsay

Was Woodrow Wilson really a Liberal?Was World War I a war of liberals against authoritarians?Founding Fathers...