Skip to content

Fix several typos under pandas/_libs #44043

New issue

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

Merged
merged 1 commit into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pandas/_libs/groupby.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def group_add(add_t[:, ::1] out,
nobs[lab, j] += 1

if nobs[lab, j] == 1:
# i.e. we havent added anything yet; avoid TypeError
# i.e. we haven't added anything yet; avoid TypeError
# if e.g. val is a str and sumx[lab, j] is 0
t = val
else:
Expand Down Expand Up @@ -1193,7 +1193,7 @@ def group_rank(float64_t[:, ::1] out,
na_option=na_option
)
for i in range(len(result)):
# TODO: why cant we do out[:, k] = result?
# TODO: why can't we do out[:, k] = result?
out[i, k] = result[i]


Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/src/klib/khash.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ khuint32_t PANDAS_INLINE murmur2_32to32(khuint32_t k){
}

// it is possible to have a special x64-version, which would need less operations, but
// using 32bit version always has also some benifits:
// using 32bit version always has also some benefits:
// - one code for 32bit and 64bit builds
// - the same case for 32bit and 64bit builds
// - no performance difference could be measured compared to a possible x64-version
Expand Down
6 changes: 3 additions & 3 deletions pandas/_libs/src/klib/khash_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void traced_free(void* ptr){
// The python 3 hash function has the invariant hash(x) == hash(int(x)) == hash(decimal(x))
// and the size of hash may be different by platform / version (long in py2, Py_ssize_t in py3).
// We don't need those invariants because types will be cast before hashing, and if Py_ssize_t
// is 64 bits the truncation causes collission issues. Given all that, we use our own
// is 64 bits the truncation causes collision issues. Given all that, we use our own
// simple hash, viewing the double bytes as an int64 and using khash's default
// hash for 64 bit integers.
// GH 13436 showed that _Py_HashDouble doesn't work well with khash
Expand Down Expand Up @@ -338,13 +338,13 @@ khuint32_t PANDAS_INLINE kh_python_hash_func(PyObject* key) {
// are possible
if (PyFloat_CheckExact(key)) {
// we cannot use kh_float64_hash_func
// becase float(k) == k holds for any int-object k
// because float(k) == k holds for any int-object k
// and kh_float64_hash_func doesn't respect it
hash = floatobject_hash((PyFloatObject*)key);
}
else if (PyComplex_CheckExact(key)) {
// we cannot use kh_complex128_hash_func
// becase complex(k,0) == k holds for any int-object k
// because complex(k,0) == k holds for any int-object k
// and kh_complex128_hash_func doesn't respect it
hash = complexobject_hash((PyComplexObject*)key);
}
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/src/datetime/np_datetime_strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ int parse_iso_8601_datetime(const char *str, int len, int want_exc,
}

parse_timezone:
/* trim any whitepsace between time/timeezone */
/* trim any whitespace between time/timeezone */
while (sublen > 0 && isspace(*substr)) {
++substr;
--sublen;
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/timezones.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ cdef object get_dst_info(tzinfo tz):
ndarray[int64_t]
Nanosecond UTC offsets corresponding to DST transitions.
str
Desscribing the type of tzinfo object.
Describing the type of tzinfo object.
"""
cache_key = tz_cache_key(tz)
if cache_key is None:
Expand Down