MCPcopy Index your code
hub / github.com/pydata/xarray / join

Method join

xarray/core/indexes.py:1451–1467  ·  view source on GitHub ↗
(self, other, how: str = "inner")

Source from the content-addressed store, hash-verified

1449 return IndexSelResult({self.dim: indexer})
1450
1451 def join(self, other, how: str = "inner"):
1452 if how == "outer":
1453 # bug in pandas? need to reset index.name
1454 other_index = other.index.copy()
1455 other_index.name = None
1456 index = self.index.union(other_index)
1457 index.name = self.dim
1458 else:
1459 # how = "inner"
1460 index = self.index.intersection(other.index)
1461
1462 level_coords_dtype = {
1463 k: np.result_type(lvl_dtype, other.level_coords_dtype[k])
1464 for k, lvl_dtype in self.level_coords_dtype.items()
1465 }
1466
1467 return type(self)(index, self.dim, level_coords_dtype=level_coords_dtype)
1468
1469 def rename(self, name_dict, dims_dict):
1470 if not set(self.index.names) & set(name_dict) and self.dim not in dims_dict:

Callers 1

test_joinMethod · 0.95

Calls 3

typeFunction · 0.85
itemsMethod · 0.80
copyMethod · 0.45

Tested by 1

test_joinMethod · 0.76