I have two questions.

First, how do I get a list of points from CountryData["UnitedStates", {{"GDP"}, {1960, 2018}}] as opposed to a graph.

Second, if I have a some data in CSV format with dates (in the form --/--/----) in one column, how do I get Mathematica to understand, when I import the data, that it must plot dates? The other column contains GDP values.

I am a beginner. I know how to import data and use ListPlot.

  • 2
    $\begingroup$ CountryData["UnitedStates", {{"GDP"}, {1960, 2018}}]["Path"] gives pairs of {date, value}. If you have CSV file like 01/02/2000,10 etc., import that as Import[file, "CSV"], then MapAt[DateList[{#,{"Month","Day","Year"}}]&,imported_file,{All,1}] and then DateListPlot[%]. $\endgroup$ – Alx Nov 6 at 16:00
  • $\begingroup$ @Alx Thank you! $\endgroup$ – Sean O'Gary Nov 6 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.