Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to open dataset in python

# Reading and writing netCDF files with xarray requires scipy or the netCDF4-Python library
# to be installed (the latter is required to read/write netCDF V4 files and use the
# compression options described below).


# 1) We can load netCDF files to create a new Dataset using open_dataset():

ds_disk = xr.open_dataset("saved_on_disk.nc")

# print data information
ds_disk
    
    
# 2) We can save a Dataset to disk using the Dataset.to_netcdf() method:
ds.to_netcdf("saved_on_disk.nc")


# Datasets have a Dataset.close() method to close the associated netCDF file.
# However, it’s often cleaner to use a with statement:

# this automatically closes the dataset after use
with xr.open_dataset("saved_on_disk.nc") as ds:
     print(ds.keys())
    
    
  
Comment

reading a dataset in python

From Datacamp
Comment

PREVIOUS NEXT
Code Example
Python :: how to replace zero value in python dataframe 
Python :: python how to find the highest even in a list 
Python :: what are arrays in python 
Python :: Fill in the empty function so that it returns the sum of all the divisors of a number, without including it. A divisor is a number that divides into another without a remainder. 
Python :: rabbitmq python 
Python :: pandas split groupby 
Python :: socket.accept python 
Python :: python tokens 
Python :: multiplication in python 
Python :: np.random.randint 
Python :: python __new__ 
Python :: Check if all values in list are greater than a certain number 
Python :: what does filename = path(file).stem python 
Python :: list comprehension in python 
Python :: mad libs generator python tutorial 
Python :: how to use iteration in python 
Python :: How to assign value to variable in Python 
Python :: python : search file for string 
Python :: show chrome devtools in selenium 
Python :: compare two excel files using python pandas 
Python :: install python cap 
Python :: how to add two strings in python 
Python :: negate an int in python 
Python :: first n prime number finder in python 
Python :: somalia embassy in bangladesh 
Python :: python for loop inside list 
Python :: exchange sort python 
Python :: how to sort by date in .csv 
Python :: perchè il metodo reverse return none 
Python :: how to open a widget using sputil.get 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =