<jupyter_start><jupyter_text><jupyter_code>import pandas as pd
import numpy as np

cit = pd.read_csv("/employees.csv")
print(cit)
import pandas as pd
import numpy as np
rea_ = pd.read_csv("/records.csv")
print(rea_)
cit_dictionary = {"name":["david","smith","kaith","larry"],
                  "Grade":[4.6,4.7,4.8,4.9],
                  "Location":["new york","kampala","Abuja","delhi"]}
cit_dataframe = pd.DataFrame(cit_dictionary)
print(cit_dataframe,"\n")
cit_column = list(cit_dataframe)
print(cit_column)
for i in cit_column:
  print(cit_dataframe[i][2],"\n")

cit_head = rea_.head(3)
print(cit_head,"\n")
cit_cclmn = list(cit_head)
for k in cit_cclmn:
  print(cit_head[k][2])

### learning missing data in pandas

# 1. isnull 
cit_isnull = {"first Team": [200,340,250,np.nan],
              "Second Team": [np.nan,200,100,400],
              "Third Team":[150,np.nan,600,700]}
cit_dt_isnull = pd.DataFrame(cit_isnull)
print(cit_dt_isnull,"\n")


print(cit_dt_isnull.isnull(),"\n")


# 2. notnull 
#cit_notnull 

print(cit_dt_isnull.notnull())

## fillna(specifier in int)
## replace(to_repalce = none , value = none)

cit_dict = {"name":["david","smith","kaith","larry"],
                  "Grade":[4.6,4.7,4.8,4.9],
                  "Location":["new york","kampala","Abuja","delhi"]}
cit_data = pd.DataFrame(cit_dict)
cit_column2 = list(cit_data)
print(cit_column2)
for i in cit_column2:
  #print(cit_data[i][2],"\n")
  print(cit_data.replace(to_replace=cit_data[i][2],value="Mbarara"),"\n")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18811234487263226, 'fraction_numerical': 0.034617896799477466, 'mean_word_length': 4.674074074074074, 'pattern_counts': {'":': 9, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '324303', 'license': 'MIT', 'n_tokens_mistral': 650, 'n_tokens_neox': 607, 'n_words': 95, 'path': 'CIT_pandas.ipynb', 'repo_name': 'isophel/Pandas', 'size': '1531'}