THREDDS & METAR Plotting with Python - netcdf4

I'm having trouble trying to plot METAR data from the THREDDS data server, which comes in .nc format, onto a map. I'm using Siphon to grab the data and Xarray to open the dataset with remote_access, but the problem comes with attempting to convert the data to .csv or .txt. When using NetCDF Dataset and attempting to read the NetCDF4 file, I get a file does not exist error. I'm not really sure where to start as there doesn't seem to be much on the internet about this. Any help would be appreciated as I'm also really new to this.

Related

jupyter Notebook cannot read head of csv file correctly

i just start learning Data Analytics, and trying to understand step by step cleaning the data, I have a example data from freeCodeCamp
https://github.com/ine-rmotr-curriculum/FreeCodeCamp-Pandas-Real-Life-Example
what I confused is in the "data/sales_data.csv" I try to read data in jupyter, but why jupyter cannot read my data properly(head of column renamed accidentally) , this is what jupyter shown on lab
and this is the data should look like before I upload it in jupyter
anyone can help me with this problem, I try other csv file and doesn't see this problem

CSV file not uploading completely or correctly using pandas dataframe

I'm pretty new to Python but I've never had trouble on this particular hurdle before.
I'm trying to load the Boston Bluebikes data using pandas dataframes. Somehow the data looks fine in Excel but uploading it throws off a bunch of errors and weird looking data.
Line of code:
jan = pd.read_csv('https://github.com/xixiant/BlueBikes/blob/master/201901-bluebikes-tripdata10.csv', engine='python', header=0, encoding='utf8', error_bad_lines=False)
Some weird data from jan.head():
0 html lang="en">
1 head>
2 meta charset="utf-8">
3 link rel="dns-prefetch" href="https://githu...
4 link rel="dns-prefetch" href="https://avata...
Here's the various data I've used:
https://github.com/xixiant/BlueBikes
What I've tried so far: 1) read through documentation on pandas.read_csv and messed with all the parameters that immediately make sense (engine, header, error bad lines, encoding), 2) Saved the csv with UTF8 3) removed all the text in the csv 4) Used sublime text to encode as UTF8 5) copied values into a google sheet and downloaded a copy as a csv
I guess if I were to keep going down this path, I'd see if there were other methods of reading in csvs that don't rely on pandas, but I really feel like I should be able to overcome this using pandas.
These are the links that seemed most promising regarding my particular question:
Python Pandas Error tokenizing data
https://www.shanelynn.ie/pandas-csv-error-error-tokenizing-data-c-error-eof-inside-string-starting-at-line/
I wouldn't be surprised if I'm doing something completely ridiculous, but man.. really? Am I just that off base? Any advice at all would be super appreciated.

Read temperature, humdity, etc from grib2 files with EECodes in python3

I am trying to use EECodes in python to get various weather information, such as temperature, humidity, etc out of grib2 files. I am using the GFS files. I would like to be able to extract the data as (lat,lon,alt,$data_point), and as a 2d array for each altitude.
I have tried the example programs located here: https://confluence.ecmwf.int/display/ECC/grib_iterator_bitmap
I can't figure out what I am looking in the output of that program. When I load the messages using their keys, it is not obvious how to make a grid. When I load the grid, the data doesn't have labels I understand.
#craeft have a look to https://github.com/ecmwf/cfgrib. cfgrib is the new standard for python and grib file handling. It is easy to install and easy to access files. Please install the latest version because it supports GFS files.

How do I use python to show data in excel?

I'm trying to display data from Python in Excel. Ideally, a pandas dataframe's worth of data would appear in a new, unsaved excel instance. My search has turned up ways to create excel files, and lots of ways to 'open' an excel file to read data from it, but no way to display it. My current approach was to create a file and then figure out how to open it, but I consider that approach second-best.
I found this. Another way would be to export your data to CSV and import it in Excel.
I found you can 'run' files with the OS library. As long as your computer knows what to do with it, you can create the xlsx file with whatever method and then run it to display:
import xlsxwriter
import os
w = xlsxwriter.Workbook(r"C:\Temp\test.xlsx")
s=w.add_worksheet("Sheet1")
s.write(1,3,"7")
w.close()
os.startfile(r"C:\Temp\test.xlsx")
Still not sure if you can work with an unsaved open instance of excel

How to Generate a csv file in python 3.7

I have a problem where I have to fetch the data through API calls using Python. I have the data. Now I have to convert it to a csv file.
We do not have to use numpy or panda. We can only use "Import collections" to generate csv file.
I am a beginner in python. Can someone help me with that please?

Resources