Closed zulfakriza closed 4 years ago
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.
Hi @zulfakriza,
For .csv files, you can follow the answer outlined at https://forum.generic-mapping-tools.org/t/how-to-load-data-into-pygmt/392, basically by using pandas. I actually made an example using earthquake data before from GNS, New Zealand at https://nbviewer.jupyter.org/github/GenericMappingTools/foss4g2019oceania/blob/master/2_pydata_and_pygmt.ipynb.
As for .dat files, you might need to upload an example as it's quite a generic format. Is it a binary format, ASCII text format, or something else?
Hi @weiji14
Many thanks for your response, then for the .dat file, I mean ASCII text format
Regards
If it's just text, then pandas.read_csv should work on that .dat file too. There's options to skip header lines, set column names, etc.
That said, some of the Data Processing functions allow you to pass the filename into PyGMT directly. So it depends on what you want to do :smile:
Hi @weiji14
Thanks a lot, I will try it
Cheers Zulfakriza
Closing the issue. Please post general questions on the GMT Community Forum.
Description of the problem
Hi, I am a new user on PyGMT, before I used GMT 5 to create some map and plotting the EQ data. But in PyGMT I had a bit issue when trying to load data (.csv or .dat) in my map.
Is there any clue how to load .csv or .dat data format in PyGMT?
Thank you
Full code that generated the error
Full error message
System information
conda list
below:output of conda list