We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following is a minimal code example of how write_var could cause the input and output to look different.
import os import numpy as np import xarray as xr import urllib from cdflib.xarray import cdf_to_xarray, xarray_to_cdf import cdflib PATH='hello.cdf' with cdflib.cdfwrite.CDF(PATH, delete=True, cdf_spec={'Compressed': 0}) as cdf: NA_CHAR = np.array([['11', '12'], ['21', '22'], ['31', '32']]) cdflib_data = NA_CHAR.tolist() # Converting to LIST. print(f'NA_CHAR.shape = {NA_CHAR.shape}') print(f'cdflib_data = """"{cdflib_data}""""') cdf.write_var( { 'Variable': 'ZV_CHAR', 'Data_Type': cdf.CDF_CHAR, 'Num_Elements': 3, 'Dim_Sizes': (3,), 'Rec_Vary': (True, True), # Req., but docs says only for rVars?! 'Var_Type': 'zVariable', 'Compress': 0, }, var_data=NA_CHAR, ) cdf = cdflib.cdfread.CDF(PATH) act_na = cdf.varget('ZV_CHAR') act_xna = cdf_to_xarray(PATH).get('ZV_CHAR').data print(f'act_na.shape = """"{act_na.shape}""""') print(f'act_xna.shape = """"{act_xna.shape}""""') print(f'act_na = """"{act_na}""""') print(f'act_xna = """"{act_xna}""""')
Questions:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following is a minimal code example of how write_var could cause the input and output to look different.
Questions:
The text was updated successfully, but these errors were encountered: