<jupyter_start><jupyter_text>Series<jupyter_code>data = [1,2,3,4,5]
s = pd.Series(data)
s
index = ['Linha' + str(i) for i in range(5)]
index
s = pd.Series(data = data, index = index)
s
 data = {'Linha' + str(i) : i + 1 for i in range(5)}
data
s = pd.Series(data)
s
s1 = s + 2
s1
s2 = s + s1
s2<jupyter_output><empty_output><jupyter_text>DataFrame<jupyter_code>data = [[1,2,3],[4,5,6],[7,8,9]]
data
df1 = pd.DataFrame(data = data)
df1
index = ['Linha' + str(i) for i in range(3)]
index
df1 = pd.DataFrame(data = data, index = index)
df1
columns = ['Coluna' + str(i) for i in range(3)]
columns
df1 = pd.DataFrame(data = data, index = index, columns = columns)
df1
data = {'Coluna0': {'Linha0': 1, 'Linha1': 4, 'Linha2': 7},
        'Coluna1': {'Linha0': 2, 'Linha1': 5, 'Linha2': 8},
        'Coluna2': {'Linha0': 3, 'Linha1': 6, 'Linha2': 9}}
data
df2 = pd.DataFrame(data)
df2
data = [(1,2,3),
        (4,5,6),
        (7,8,9)]
data
df3 = pd.DataFrame(data = data, index = index, columns = columns)
df3
df1[df1 > 0] = 'A'
df1
df2[df2 > 0] = 'B'
df2
df3[df3 > 0] = 'C'
df3
df4 = pd.concat([df1,df2, df3])
df4
df4 = pd.concat([df1,df2, df3], axis = 1)
df4
dados = [[1, 2, 3], [4, 5, 6]]
index = 'X,Y'.split(',')
columns = list('CBA')[::-1]
df = pd.DataFrame(dados, index, columns)
df<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.21450381679389313, 'fraction_numerical': 0.07251908396946564, 'mean_word_length': 4.265060240963855, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '39448', 'license': 'MIT', 'n_tokens_mistral': 639, 'n_tokens_neox': 616, 'n_words': 153, 'path': 'Curso Pandas #3.ipynb', 'repo_name': 'evandrocapo/Data-Science', 'size': '1310'}